Combo Box in Primal forms

This topic contains 4 replies, has 2 voices, and was last updated by Profile photo of Barry Thomson Barry Thomson 3 years, 5 months ago.

  • Author
    Posts
  • #11727
    Profile photo of Barry Thomson
    Barry Thomson
    Participant

    Hello,

    Does anyone know how to, or have any good links to somewhere explaining how to use the Combo Box in Primal forms?

    I'm looking to add a few pre-defined entries available from the drop down, and when these are selected it loads a variable.

    I've read the article below, but I can't really make any sense of it.

    Cheers

  • #11729
    Profile photo of Don Jones
    Don Jones
    Keymaster

    Well, $box.Items.Add('whatever') is how you'd add an item. Is there some other specific part of this that you need help with?

  • #11730
    Profile photo of Barry Thomson
    Barry Thomson
    Participant

    Hi Don,

    What I'm trying to figure out is, once the choice is made, for example, you have set the box to 'ComputerA', how do you take that value and use it somewhere else?

    Cheers

  • #11731
    Profile photo of Don Jones
    Don Jones
    Keymaster

    So, there's an event you have to attach code to if you want to do something when someone changes the value of the control. Usually, you don't do that – you just let them dicker around until they hit an OK button, and then you read the values.

    To read the value, it's just $box.SelectedItem.

    You also have to distinguish between a ComboBox (a list of values, but the user can type their own) or a simple DropDownList (just a list of values, must pick one). You set a property of the combo box to tell it how to behave. You can do that in the designer.

    SAPIEN also runs a great set of forums to help people with GUI issues – drop by there if you need specifics. I don't use the product every day, so I don't have all the answers off the top of my head.

  • #11732
    Profile photo of Barry Thomson
    Barry Thomson
    Participant

    Thank you, Don. This has helped, something has clicked! 🙂

    Cheers man

You must be logged in to reply to this topic.