Persist highlight in CListCtrl after double click
Figured it out. LVIF_STATE should have been LVIF_IMAGE. See, I knew it was elementary...
I have a CListView derived class with an OnDoubleClick() handler in a VC++6.0 project. I need to persist the highlighting of the selected item after the OnDoubleClick() handler has done its thing. I had thought that
GetListCtrl().SetItemState(m_nHighlightIndex,LVIS_SELECTED, LVIF_STATE);
would do the trick (assuming that m_nHighlightIndex holds the index of the selected item), but no combination of that and various attempts to invalidate the client area has worked, in either OnDoubleClick() or OnUpdate(). This seems like s开发者_开发知识库uch an elementary thing to do, but thus far it baffles me. Any help would be greatly appreciated.
Just so it looks answered (and apologies if this is bad form):
LVIF_STATE should have been LVIF_IMAGE. See, I knew it was elementary...
精彩评论