listview TacListView component
Hierarchy Properties Methods Events
Return to Introduction  Previous page  Next page
The acListView component is the advanced ListView which can automatically sort columns, displaying the arrow-style sorting mark, which represents the sorting direction (like in the MS-Outlook).  
The acListView sorts items automatically and does not require any additional programming. However, the custom sorting are still supported. The acListView recognizes the format of list items and can automatically sort the text, numerical and date/time values when the sorting rules or any list item changes.  
Sorting demo (ViewStyle = vsReport, SortType = stData)  
Contains a lot of additional features, such like popup menus for the header columns, tooltips for the list items which doesn't fits the column size (complete customization of tooltip appearance and placement), custom cursors for various non-client parts of ListView.  
Dragging demo (FullDrag = True)  
If you're still using old versions of Delphi / C++ Builder 2 or 3 you will also pleasantly surprised that the acListView supports features which become available in higher Delphi versions. This is grid lines, row selecting, flat scroll bars, hot tracking and hot track styles and so forth…  
Tooltips demo (the line does not fits the column size)  
new! acListView supports custom multiline tooltips for list items. Write OnToolTip event handler to specify tooltips. Also was implemented so-called "thumb-tracking" tips for vertical scroll bar. When user drags the thumb, the acListView shows the hint with caption of top item of current sorted column (see ShowScrollTips property).  
Multiline tooltips"Thumb-tracking" tips (ShowToolTips = True)  
aclistviewss9 aclistviewss10  
The acListView is able to automatically save and restore sorting rules and widths of the list columns on exit / startup of your program. You don't need to write any code and just select the registry key where you would like to store settings and set Enabled property of the RegistrySaver structure to True.  
Custom header menu demo (see HeaderMenu property)  
OnCustomDrawSubItemEx event demo  
aclistviewss12 <--  
Windows XP look  
In addition, the acListView contains some bugfixes of regular TListView. Was corrected a common control bug which appears when the color scheme of the system is changed. The dragging process (when user drags the columns) displayed more properly.  
new! The acListView automatically copies the text from selected rows/columns to clipboard when user press Ctrl+C or Ctrl+Ins keys. Alternatively you can use CopySelectionToClipboard method.  

Advanced / Improved properties
Cursorsspecifies custom cursor images for various parts of list view (i.e: border, divider between header sections, header, vertical and horizontal scroll bars);  
EmptyListMessagespecifies the text for special label which can be visible when the list is empty (there are no items in the view);  
HeaderFontspecifies the custom font for the text on the column header;  
HeaderMenuspecifies custom popup menu for column header;  
HeaderStylespecifies the style of header sections (buttons or flat);  
RegistrySaverstructure for saving / restoring listview's settings to the registry;  
ShowEmptyListMessagedetermines whether the special text label should be visible when the list is empty ((there are no items in the view);  
ShowHeaderMenuenables or disables popup menu for column headers;  
ShowScrollTipsenables or disables the hints on dragging the thumb of scrollbar;  
ShowSortMarkshows or hides sort mark (small triangle) on header sections;  
ShowToolTipsenables or disables the tooltips for items with long text;  
SortColumnspecifies the column number which must be sorted;  
SortDirectionspecifies the sorting direction;  
SortMarkAligncontrols appearance of the sort mark on header section;  
SortMarkKindcontrols the style of the sort mark;  
ToolTipOptionssome preferences for tooltips.  

New / improved methods
BestFitadjusts the column widths (of report-style list-view) thus the text of all subitems will fit to the widths of columns.  
CopySelectionToClipboardcopies all text from selected rows/columns to clipboard;  
GetColumnAtreturns the column number by X (mouse) position;  
GetItemAtreturns list item from X/Y position;  
ExportToTXTsaves all items and column names to TXT file;  
ExportToHTMLsaves all items and column names to simple HTML file;  
SetColumnOrderssets the orders of header items of the listview, or copies the orders from another listview.  

New events
OnColumnDraggedoccurs when user reorders the columns using a mouse;  
OnColumnResizeBeginoccurs when user about resize the column. Allows to disallow resizing;  
OnColumnResizeEndoccurs when user finished resizing the column;  
OnCustomDrawSubItemExa bug-free replacement of standard event used when a subitem must be rendered in the list-view;  
OnDrawHeaderSectionevent handler for custom drawing of the header section;  
OnMouseEnteroccurs when mouse hovers the control;  
OnMouseLeaveoccurs when mouse leaves the control;  
OnSettingsChangedoccurs when system settings changes (i.e: you need to refresh some list values which appearance depends on regional settings);  
OnToolTipoccurs when the tooltip is about to be displayed. Write this handler to specify custom text for tooltip.  

See also
acDBListView and acTreeView components.