I'm trying to select an item in a listview from code. However I'm having some problems. Both
andCode:ListView_SetItemState(ListViewHandle, 4, LVIS_SELECTED, LVIS_SELECTED)don't work. However sendmessage does return TRUE.Code:SelectListViewItemMessage.state = LVIS_SELECTED; SelectListViewItemMessage.stateMask = LVIS_SELECTED; SendMessage(ListViewHandle, LVM_SETITEMSTATE, (int) 4, (LPARAM) &SelectListViewItemMessage);
Mayb it is due to the style of the listview? It has the following style (there is always only 1 item selected never 0 never more than 1):Code:WS_CHILD LVS_REPORT WS_VISIBLE LVS_SINGLESEL WS_VSCROLL LVS_SHOWSELALWAYS WS_TABSTOP LVS_SHAREIMAGELISTS LVS_OWNERDRAWFIXED LVS_NOCOLUMHEADER ExStyle: 0x0


Reply With Quote
Vlad - MS MVP [2007 - 2012] - 
Bookmarks