LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ListBox selection

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

0 Kudos
Message 1 of 6
(3,400 Views)

Hi,

 

you will need the functions GetNumListItems and IsListItemChecked; for example code using these functions see the project listbox.cws

0 Kudos
Message 2 of 6
(3,398 Views)

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

0 Kudos
Message 3 of 6
(3,393 Views)

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

 

 

Message 4 of 6
(3,391 Views)

@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"...

Christopher Povey

Principle Test Systems Engineer for BAE Systems.
0 Kudos
Message 5 of 6
(3,379 Views)

Christopher,

 

Thanks for that.

 

I had already started down the “tree” track, so I stuck with in and got the required result.

 

Thanks

Simon

0 Kudos
Message 6 of 6
(3,371 Views)