LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

When using the arrows to change the value of the Listbox, the value never change

Hei friends,
I want to know why when I'm using a listbox with arrows and I change the value of this listbox "only" from the arrows, the index of this listbox and also the value they never change. Only if I click with the mouse inside the listbox, then the value and the index change. Do I need a kind of update before I try to read the value or the index with the functions GetCtrlVal or GetCtrlIndex? At the moment I have solved the problem using the event LEFT_CLICK_EVENT to update the value by myself, but I'm sure there is a better solution.

Thanks in advance,


Josue
0 Kudos
Message 1 of 3
(3,205 Views)
Hello

If you are using only the arrows on the list box, you are not changing the item selected in a list box. You are actually scrolling up and down the list box. If you use the keyboard arrow keys, you will be that the highlighting box in the listbox actually changes. And you will also see that the VALUE_CHANGED event file.
To change the item selected, you will have to use the arrow keys on the keyboard or actually select the item using the mouse cursor.

Hope this helps
Bilal Durrani
NI
0 Kudos
Message 2 of 3
(3,198 Views)
If you need to select an item included in the list only using the arrows, you must change your control to a ring with arrows. The selected ("active") element in the list does not change by using the scroll bar (the only arrows a listbox can have).

Unfortunately this type of ring does not permit you to see all list elements before selecting one of them unless you click inside the control with the mouse.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 3
(3,197 Views)