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?

Is a TButton in the header of VirtualStringTree possible?

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

Registriert seit: 13. Feb 2015
Ort: Kerpen
211 Beiträge
 
Delphi 12 Athens
 
#1

Is a TButton in the header of VirtualStringTree possible?

  Alt 12. Aug 2020, 09:14
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?
  Mit Zitat antworten Zitat
Benutzerbild von KodeZwerg
KodeZwerg

Registriert seit: 1. Feb 2018
3.685 Beiträge
 
Delphi 11 Alexandria
 
#2

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

  Alt 12. Aug 2020, 09:37
There's an Topic with same content on Stackoverflow. Here is the link. Does that solve your question?
Gruß vom KodeZwerg
  Mit Zitat antworten Zitat
Aviator

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

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

  Alt 12. Aug 2020, 09: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
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

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 22:01 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz