![]() |
![]() ![]() ![]() |
acListView and acDBListView components.
|
type
|
TacListViewToolTipEvent = procedure(Sender: TObject; var ToolTipText: String; Item: TListItem; LogicalCol: Integer) of object;
|
|
property OnToolTip: TacListViewToolTipEvent;
|
The OnToolTip event occurs when the acListView is about to show the tooltip (hint) for some partially hidden list item.
|
|
Write OnToolTip event handler to specify custom text for the tooltips. Use ToolTipText parameter to get or set the tooltip text for specific list item. To determinate the list item under mouse pointer use Item parameter. To determinate whether this item was a subitem read the column number from the LogicalCol parameter.
|
![]() |
procedure TformSearch.SearchResultsListViewToolTip(Sender: TObject;
|
var ToolTipText: String; Item: TListItem; LogicalCol: Integer);
|
begin
|
with SearchResultsListView do
|
if ToolTipText = '' then
|
begin
|
// Dynamically change the tooltip style
|
ToolTipOptions := [ttoLongStay, ttoOffset];
|
with Item do
|
ToolTipText := 'Name: ' + Item.Caption + #13#10 +
|
'Sex: ' + SubItems[0] + #13#10 +
|
'Age: ' + SubItems[1] + #13#10 +
|
'Location: ' + SubItems[2];
|
end
|
else
|
// Dynamically change the tooltip style
|
ToolTipOptions := [];
|
end;
|
ShowToolTip and ToolTipOptions properties.
|