07-13-2012 10:12 AM
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
Solved! Go to Solution.
07-13-2012 10:32 AM
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.
07-13-2012 10:39 AM
hi
where can i find this project, there is not in the help of labwindows
07-13-2012 10:46 AM
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/
07-13-2012 10:46 AM
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);
}
}
07-13-2012 10:52 AM
...because the combo box is not a ring control but based on a string control
07-13-2012 10:54 AM
in fact it's a listitem but it is the same as a combobox.