how to find index value of SetItemState() in CListCtrl

Refresh

6 days ago

Views

14 time

3

I have a CListCtrl where i have to find the index value of

m_searchListCtrl.SetItemState(index, 0, LVIS_SELECTED);

I have tried this let me know if its correct :

int index = m_searchListCtrl.GetNextItem(-1, LVNI_SELECTED);

This is the actual code

int index = m_searchListCtrl.GetNextItem(-1, LVNI_SELECTED);
m_searchListCtrl.SetItemState(index, 0, LVIS_SELECTED);

I need the index value to deselect an item from CListCtrl using SetItemState()

0 answers