LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

invert a particular line in a list box

    I am new to labWindows / CVI . Here in my programme I want  inversion i.e selection of a particular line in a list box , without up and down key pressing or clicking mouse over a line .Waiting for someone's response .
 
subrata
0 Kudos
Message 1 of 2
(2,766 Views)

A listbox is a control that holds a list of lable/value elements, each of them can be addressed via its index (which is unique in the control) and has an associated value (which can be the same for more that one element).

Given this, a listbox element can be programmatically highlighted setting the control index to the desired value: index is zero-based, so SetCtrlIndex (panel, control, 2) selects (=highlights) row #3 in the listbox (if present: otherwise it should select the last one).

One problem is that highlighting means inversion of colors only when the listbox is the active control: when focus is moved to another control, highlighting becomes a dotted line arount the active element. If you want to permanently invert text and background colors of a particular list item you will need to embed special escape codes in the list item label: help on this subject can be found in on-line help for InsertListItem function.



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?
Message 2 of 2
(2,761 Views)