selection in clistctrl
-
Search as I may, I cannot find how to set a selection in a clistctrl from within code ( as in preseting a selection when the control is first populated ). Also, I notice that whenever the dialog bar containing the list control is significantly moved ( un/docked, un/hidden ) the highlighted selection disappears. Can anyone tell me how to handle these things? I imagine they're fairly simple. Thanks in advance.:confused:
-
Search as I may, I cannot find how to set a selection in a clistctrl from within code ( as in preseting a selection when the control is first populated ). Also, I notice that whenever the dialog bar containing the list control is significantly moved ( un/docked, un/hidden ) the highlighted selection disappears. Can anyone tell me how to handle these things? I imagine they're fairly simple. Thanks in advance.:confused:
To set the selection: ListView_SetItemState ( hwndYourList, nIndexToSelect, LVIS_SELECTED, LVIS_SELECTED ); You can add LVIS_FOCUSED to the flags to set the focus rectangle to the item as well. --Mike-- http://home.inreach.com/mdunn/ #include "buffy_sig"