12-21-2011 09:56 AM
Hi,
I have a ListBox into which I have programmatically, from an ini file, put in a number of test names one of which will be selected, the test name is got and handed to TestStand.
1. Is the ListBox the best option?
2. I would like to know which has been selected?
Thanks for the help/direction
Simon
12-21-2011 10:18 AM
Hi,
you will need the functions GetNumListItems and IsListItemChecked; for example code using these functions see the project listbox.cws
12-22-2011 03:24 AM
Wolfgang
Thanks for that it has got me started.
Also required I must restrict to one choice only, so if item 1 is selected they can changed their mind to select item 3, but only one, is the ListBox the best option.
Then the focus (is this correct term) should go to the OK button.
Thanks
Simon
12-22-2011 03:42 AM
Simon,
I didn't answer 'the best' question intentionally, as this depends on several aspects... If your UI has enough space, and the number of items is not too large, one could also use a radio Group (Custom Controls/Toolslib Controls), for example.
Setting the focus on a button can be achieved with the SetActiveCtrl (,) function.
Wolfgang
12-22-2011 07:20 AM - edited 12-22-2011 07:23 AM
@Srm27 wrote:
Wolfgang
Thanks for that it has got me started.
Also required I must restrict to one choice only, so if item 1 is selected they can changed their mind to select item 3, but only one, is the ListBox the best option.
Then the focus (is this correct term) should go to the OK button.
Thanks
Simon
Combo box would allow only one option to be selected (if the list is large, or you want the contents set dynamically).
Edit: NI LabWindows calls Combo boxes "Rings"...
12-22-2011 09:41 AM
Christopher,
Thanks for that.
I had already started down the “tree” track, so I stuck with in and got the required result.
Thanks
Simon