Click to See Complete Forum and Search --> : How to manually force a list control selection (by program)


junpin Li
April 13th, 1999, 09:24 PM
I know clicking mouse will automatically set status to indicate a user select a row from a list control. Now I want to use program to force a selection on a row. What is the best way to do this? Thanks.

Franky Braem
April 14th, 1999, 01:27 AM
You can use this method of the CListCtrl :

SetItemState(nRow, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);