- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm using a list control with view set to report. It works perfectly well for the most part, but I'd like all items in a particular row to be highlighted when the user clicks on any item in that row. However, I can only get items in the leftmost column to be highlighted, and then only when I click directly on the item. Is there a way to do this?
With many thanks in advance,
MIke
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Add LVS_EX_FULLROWSELECT to list view's extended styles.
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jugoslav,
Thankyou for that, it works fine. I'm using the following to determine which item was selected:
case(WM_NOTIFY)
if(uParam==IDC_selection)then
pListView = lparam
if(pLvdi%hdr%code==LVN_ITEMACTIVATE)then
iret = SendMessage(hWndList,LVM_GETNEXTITEM, &
-1,MAKELPARAM(LVNI_SELECTED,0))
it = iret + 1
end if
end if
if(uParam==IDC_selection)then
pListView = lparam
if(pLvdi%hdr%code==LVN_ITEMACTIVATE)then
iret = SendMessage(hWndList,LVM_GETNEXTITEM, &
-1,MAKELPARAM(LVNI_SELECTED,0))
it = iret + 1
end if
end if
This works as long as I double click the selected row. How can I make it work from a single click?
With many thanks again,
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Any chance it received LVS_EX_TWOCLICKACTIVATE somehow (=#80 = WS_EX_TOOLWINDOW)?
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jugoslav,
I created the list control by selecting it from the Control tool palette. It is Visible, is a Tab stop, is of Report style, and has a Border. No other options are selected. So the answer to your question is no, but you gave me a clue - I have sent it LVS_EX_ONECLICKACTIVATE, and now it works perfectly.
Many thanks again for your help,
Mike

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page