ClistCtrl is set to single selection & single column in report view with no header.
I have tried SetItemState(0,LVIS_SELECTED,LVIF_STATE)
andSetSelectionMark(int index)
but these don't work.
RE: How to get the index of selected item of a CListCtrl int index = pList->GetNextSelectedItem(pos); AfxMessageBox("Item %d was selected!\
Provided that the index of the item fo be selected is w_nCurIdx, Use the following code
m_pSPSMapList.SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT);
m_pSPSMapList.SetItemState(w_nCurIdx, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With