Can CListCtrl select all the row (not only the iSubItem=0 part)?
-
Is there a way a CListCtrl in ReportView mode will select all the row when selecting one and not only the first iSubItem ??? Waht i mean is that when selecting rows in Report view mode only the first column of this row is selected. I want to be able to select all the row (all the SubItems) in the same click on the row. Can this be done ? Thanks in advance, Ariel.
-
Is there a way a CListCtrl in ReportView mode will select all the row when selecting one and not only the first iSubItem ??? Waht i mean is that when selecting rows in Report view mode only the first column of this row is selected. I want to be able to select all the row (all the SubItems) in the same click on the row. Can this be done ? Thanks in advance, Ariel.
Yes, you can select the whole row.
//set extended list view styles
DWORD dwStyle = pList->SendMessage( LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0 );
dwStyle = dwStyle | LVS_EX_FULLROWSELECT;
pList->SendMessage( LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle );Daniel "das leid schlaft in der maschine" -Einstürzende Neubauten
-
Is there a way a CListCtrl in ReportView mode will select all the row when selecting one and not only the first iSubItem ??? Waht i mean is that when selecting rows in Report view mode only the first column of this row is selected. I want to be able to select all the row (all the SubItems) in the same click on the row. Can this be done ? Thanks in advance, Ariel.
You can do it Daniel's way or, // Set the listview style. Add features that you like. List.SetExtendedStyle ( m_fList.GetExtendedStyle() | LVS_EX_FULLROWSELECT // Select all items when clicked | LVS_EX_GRIDLINES // Draw gridlines. I like them. | LVS_EX_TRACKSELECT // Hover if you wish etc. ); Probably both the same. The secret is the Extended Style business. I'm just passing on what I was told on this site. And it works too.
-
You can do it Daniel's way or, // Set the listview style. Add features that you like. List.SetExtendedStyle ( m_fList.GetExtendedStyle() | LVS_EX_FULLROWSELECT // Select all items when clicked | LVS_EX_GRIDLINES // Draw gridlines. I like them. | LVS_EX_TRACKSELECT // Hover if you wish etc. ); Probably both the same. The secret is the Extended Style business. I'm just passing on what I was told on this site. And it works too.
-
Hi there, First, Thanks alot for the answer it was really helpful and it have a nice view this way. The only thing i don't understand whats the : "| LVS_EX_TRACKSELECT // Hover" ? If you can tell me that too i'll be very thankfull, Ariel.
Look up "Extended list view styles" in the Visual Studio help index. You can do a lot of interesting things in a list view control. LVS_EX_TRACKSELECT Version 4.70. Enables hot-track selection in a list view control. Hot track selection means that an item is automatically selected when the cursor remains over the item for a certain period of time. The delay can be changed from the default system setting with a LVM_SETHOVERTIME message. This style applies to all styles of list view control. You can check whether or not hot-track selection is enabled by calling SystemParametersInfo.
-
Look up "Extended list view styles" in the Visual Studio help index. You can do a lot of interesting things in a list view control. LVS_EX_TRACKSELECT Version 4.70. Enables hot-track selection in a list view control. Hot track selection means that an item is automatically selected when the cursor remains over the item for a certain period of time. The delay can be changed from the default system setting with a LVM_SETHOVERTIME message. This style applies to all styles of list view control. You can check whether or not hot-track selection is enabled by calling SystemParametersInfo.
-
Yes, you can select the whole row.
//set extended list view styles
DWORD dwStyle = pList->SendMessage( LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0 );
dwStyle = dwStyle | LVS_EX_FULLROWSELECT;
pList->SendMessage( LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle );Daniel "das leid schlaft in der maschine" -Einstürzende Neubauten