SysListView32 like mouse selection rectangle

830 Views Asked by At

Can I make a mouse selection rectangle in a List View like in a SysListView32? enter image description here

Is there a way to work with a SysListView32 and use it in Delphi?

Thanks!

2

There are 2 best solutions below

1
On BEST ANSWER

You need to set LVS_EX_DOUBLEBUFFER style of the list view (only applicable with comctl32.dll version 6.0 (XP) and later):

[...] This extended style also enables alpha-blended marquee selection on systems where it is supported.


uses
  commctrl;
..

ListView_SetExtendedListViewStyle(ListView1.Handle, LVS_EX_DOUBLEBUFFER);


It also works with the TShellListView component included as a demo. See this answer to find out how to find and install the shell controls.

(PS: Don't forget to set Multiselect to true)

3
On

The site appears to be down currently, but there's a Delphi ListView component available for free from Mustangpeak that has this feature and more that are found in the modern Windows list view.