This topic contains 4 replies, has 2 voices, and was last updated by
November 29, 2013 at 2:26 pm #11727
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.
November 29, 2013 at 3:14 pm #11729KeymasterPoints: 1,704Rank: Community Hero
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?
November 29, 2013 at 3:55 pm #11730
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?
November 29, 2013 at 3:59 pm #11731KeymasterPoints: 1,704Rank: Community Hero
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.
November 29, 2013 at 4:16 pm #11732
Thank you, Don. This has helped, something has clicked! 🙂
The topic ‘Combo Box in Primal forms’ is closed to new replies.