Selecting list control subitems
-
I am using an MFC CListCtrl with multiple columns. I have two related problems: 1. I can select an item (column 0) by left or right clicking on it but subitems don't respond when clicked. I would like to pop up a floating menu on any item or subitem when right clicked. 2. There seems to be no way that I can get the control to set the subitem attribute to selected (LVIS_SELECTED) and display blue. I have looked at SetItemState (no good, can't see subitems) and SetItem (does not work, just ignores the status change). Does anyone know how to make this SOB do as it is told and allow me to select a subitem? Has anyone done this without MFC using only the SDK API?
-
I am using an MFC CListCtrl with multiple columns. I have two related problems: 1. I can select an item (column 0) by left or right clicking on it but subitems don't respond when clicked. I would like to pop up a floating menu on any item or subitem when right clicked. 2. There seems to be no way that I can get the control to set the subitem attribute to selected (LVIS_SELECTED) and display blue. I have looked at SetItemState (no good, can't see subitems) and SetItem (does not work, just ignores the status change). Does anyone know how to make this SOB do as it is told and allow me to select a subitem? Has anyone done this without MFC using only the SDK API?
Make this call:
yourListCtrl.SetExtendedStyle( yourListCtrl.GetExtendedStyle() | LVS_EX_FULLROWSELECT;
Then, clicking anywhere in a row will select the whole row. This requires v4.70+ of the common controls. --Mike-- http://home.inreach.com/mdunn/ Time is an illusion; lunchtime doubly so. -
Make this call:
yourListCtrl.SetExtendedStyle( yourListCtrl.GetExtendedStyle() | LVS_EX_FULLROWSELECT;
Then, clicking anywhere in a row will select the whole row. This requires v4.70+ of the common controls. --Mike-- http://home.inreach.com/mdunn/ Time is an illusion; lunchtime doubly so.A thousand blessings upon you! Works like a charm. (It's all there in the MSDN too. I must be getting old and blind.)