AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein GUI-Design mit VCL / FireMonkey / Common Controls Is a TButton in the header of VirtualStringTree possible?
Thema durchsuchen
Ansicht
Themen-Optionen

Is a TButton in the header of VirtualStringTree possible?

Ein Thema von softtouch · begonnen am 12. Aug 2020 · letzter Beitrag vom 12. Aug 2020
 
Aviator

Registriert seit: 3. Jun 2010
1.611 Beiträge
 
Delphi 10.3 Rio
 
#3

AW: Is a TButton in the header of VirtualStringTree possible?

  Alt 12. Aug 2020, 10:49
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;
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:35 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 by Thomas Breitkreuz