02-09-2007 04:10 AM
02-09-2007 05:03 AM
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.