![]() |
Is a TButton in the header of VirtualStringTree possible?
I need a button in the header of the virtualstringtree, or a way to know about when the icon in the header is clicked, but I cant find anything in google or in the source about such thing. Is this possible at all?
|
AW: Is a TButton in the header of VirtualStringTree possible?
There's an Topic with same content on Stackoverflow. Here is the
![]() |
AW: Is a TButton in the header of VirtualStringTree possible?
Why don't you simply use the OnHeaderClick Event? There you have a HitInfo parameter which provides you the position where the user clicked on.
Delphi-Quellcode:
procedure TfrmMain.vstHeaderClick(Sender: TVTHeader; HitInfo: TVTHeaderHitInfo);
begin if (HitInfo.HitPosition = hhiOnIcon) then begin // Do something here end; end; Pro tip: Check out the VirtualTreeView source code. This is the best documentation you can get. Or simply ask here if you don't know how to do it. :)
Delphi-Quellcode:
// Structure used when info about a certain position in the header is needed.
TVTHeaderHitInfo = record X, Y: Integer; Button: TMouseButton; Shift: TShiftState; Column: TColumnIndex; HitPosition: TVTHeaderHitPositions; end; // These flags are used to indicate where a click in the header happened. TVTHeaderHitPosition = ( hhiNoWhere, // No column is involved (possible only if the tree is smaller than the client area). hhiOnColumn, // On a column. hhiOnIcon, // On the bitmap associated with a column. hhiOnCheckbox // On the checkbox if enabled. ); TVTHeaderHitPositions = set of TVTHeaderHitPosition; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:08 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz