LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

get selected item in combobox

Solved!
Go to solution

hi all,

i need to get the selected item from a combobox, there are functions i see. But no one seems answer the need.

best regards

0 Kudos
Message 1 of 7
(3,653 Views)

Did you check the combodemo project? There you read the (selected) text value from the string control and compare it with your predefined text strings.

0 Kudos
Message 2 of 7
(3,651 Views)

hi

where can i find this project, there is not in the help of labwindows

0 Kudos
Message 3 of 7
(3,649 Views)

The simplest is using the NI Example Finder, search for combo and it will list two projects.

 

You can find it also in the help (with some luck), search for combo, choose combo box function tree, choose one function and scroll to the end of the page where it will list two examples.

 

On my system, it is in Documents and Settings/All Users/Documents/National Instruments/CVI2010/samples/userint/custctrl/

0 Kudos
Message 4 of 7
(3,647 Views)

This code is supposed works to get the selected item but ther is an error which is in the function IsListItemChecked: attribute passed invalid. What is the error 

for (int i=0;i<maxitems;i++) {
IsListItemChecked (PANEL, PANEL_RING, 1,&checked);
if (checked)
{
GetValueFromIndex (PANEL, PANEL_RING, i, value);
GetLabelFromIndex (PANEL, PANEL_RING, i, label);
}
}

0 Kudos
Message 5 of 7
(3,646 Views)
Solution
Accepted by topic author FibiIA

...because the combo box is not a ring control but based on a string control

0 Kudos
Message 6 of 7
(3,641 Views)

in fact it's a listitem but it is the same as a combobox.

0 Kudos
Message 7 of 7
(3,638 Views)