Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SysListView32 like mouse selection rectangle

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!

like image 411
maxfax Avatar asked Aug 17 '11 00:08

maxfax


2 Answers

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)

like image 151
Sertac Akyuz Avatar answered Oct 07 '22 17:10

Sertac Akyuz


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.

like image 35
Nathanial Woolls Avatar answered Oct 07 '22 15:10

Nathanial Woolls