Getting a selected item in a List Control, changing subitems
-
05-07-2021 - |
Question
How can I catch a click on an item, and then change all it's subitems states?
I know I can get the selected item with GetFirstSelectedItemPosition, but how do I use the SetItemState on the given position?
EDIT: I was basically looking for this: m_ListControl.SetExtendedStyle(LVS_EX_FULLROWSELECT)
No correct solution
OTHER TIPS
Create a notification handler for the LVN_ITEMCHANGED
notification. This handler will be called whenever a new item has been selected either using the mouse or the keyboard. If you particularly need to handle mouse clicks, create a notification handler for the NM_CLICK
notification instead.
Both event handlers' LPARAM
parameter points to a structure that contains a member called iItem
. This is the index to the item just selected or clicked. Use this iItem
as the first parameter to the SetItemState
method.