HsiaLin wrote:Is it possible to force listview into mouse selection mode?
theLizard wrote:I know that with ListView you can hold left mouse button down and drag over List View items and/or Ctrl Click Items when non contiguous selection is required, I use this approach with my Desk Top Organizer (uses ListView) http://bcbhelper.com/downloads/DeskTopOrganizer.zip
Is this what you mean?
HsiaLin wrote:In windows explorer you can mouse select from anywhere in the list.
Marquee (lasso) selection in full row selection mode Pin
I just discovered another undocumented feature, which is used by Windows Vista's Explorer if I remember correctly: If full row selection is enabled, it's difficult to select multiple items by dragging a lasso around them. If you call the SetSelection method of the IListView interface with both parameters set to 0x1, the list view won't select items if you click onto the empty space in the item's row, or to be more precise: selection is done on mouse-up then, not on mouse-down. This provides easier marquee selection in full row selection mode.
However, this feature is buggy. It assumes that all columns contain left-aligned text. In columns that contain centered or right-aligned text, behavior is a bit strange, because clicking onto a row's white space can select the item row as well as start marquee selection - depending on whether the click position is to the right of where the text would end if it was left-aligned.
Actually there is a way to mimic Explorer selection behavior. It requires a lot of additional declarative work, but it is possible.
You need to get undocumented IListView interface via undocumented LVM_QUERYINTERFACE message (note that interface declaration and GUIDs are different for Windows Vista and Windows 7+). Details about constants and declarations can be found here:
• IListView at Geoff Chappell - Software Analyst or
• Undocumented List View Features at Code Project.
After acquiring the interface all you need is simply a call to SetSelectionFlags(1, 1) method. Voila you are done.
Users browsing this forum: Bing [Bot] and 10 guests