No announcement yet.

I need help Combobox1

  • Filter
  • Time
  • Show
Clear All
new posts

  • I need help Combobox1

    ok the setup what my combbox1 looks like in the settings tab

    Item Text Item Data
    1 A Nightmare on Elm Street
    2 Adventure Island
    3 Adventure Island II
    and so on there 50 name in my list

    what I have in Script tab under the on select tab

    if e_Selection== 1 then
    -- Changes to page 1

    if e_Selection== 2 then
    -- Changes to page 2

    if e_Selection== 3 then
    -- Changes to page 3
    and so on there 50 pages to represent each game

    it works with some problems can you help

    Problem 1
    when I select a name (item) on the combobox1 it will jump to the proper page under the name how ever the names move and then its not what I selected it jumps around as you pick a name?

    I pick this Adventure Island II in the combobox1
    I get the page
    then Ill pick A Nightmare on Elm Street in the combobox1
    it will show page but the name in the box will be Adventure Island II

    Problem 2
    I would like to know if I selected a name (item)
    lets say Adventure Island II which is page3 in my Project
    how can I make it stay selected in the combobox1 on page3

    I load my project up A Nightmare on Elm Street is the first thing you see
    I select from the combobox1 Adventure Island II it goes to the proper page
    but in the box it says A Nightmare on Elm Street I need it to say Adventure Island II

    I'm a green new be at this so please try to keep it simple for me

    I hope that what I gave you all is enough to understand my situation
    thanks for any help

  • #2
    You can make a better code, like this:
    if e_Selection == 1 then Page.Jump("Page1");
    elseif e_Selection == 2 then Page.Jump("Page2");
    elseif e_Selection == 3 then Page.Jump("Page3");
    elseif e_Selection == 4 then Page.Jump("Page4");
    Or you can make it with ComboBox.GetSelected command, not with e_Selection.

    I tested it, and it works fine in all segments that you say that doesnt working fine. Maybe the problem is in your code style or object settings, or probably somewhere else in your other code.
    Problem 1, it shows what you selected.
    Problem 2, what you selected it will stay selected.

    Also, if your "Page#" doesnt have something big, you can create Dialogs, or Main window with ComboBox in Dialog, and selected things in Pages.


    • #3
      If you REALLY want to be elegant with this, you could write one line of code only:


      That's it


      • #4
        Originally posted by yosik View Post
        If you REALLY want to be elegant with this, you could write one line of code only:


        That's it
        Good :yes