Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi TTitleBarPanel Popup-Menü? (https://www.delphipraxis.net/213893-ttitlebarpanel-popup-menue.html)

PeterPanino 16. Okt 2023 10:38


TTitleBarPanel Popup-Menü?
 
TTitleBarPanel hat in Delphi 11.3 noch immer keine PopupMenu property. So muss ich als Workaround ein transparentes Dummy TImage mit Align = Client auf dem TTitleBarPanel verwenden, um mit dessen PopupMenu property ein Kontextmenü in der Titelleiste aufzurufen.

PeterPanino 16. Okt 2023 11:34

AW: TTitleBarPanel Popup-Menü?
 
TIPP: Da man mit diesem Workaround das Fenster nicht mehr durch Draggen der Titelleiste bewegen kann, gibt es auch dafür einen Workaround:

Delphi-Quellcode:
procedure TForm1.ImageDummyTitlebarMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
const
  SC_DRAGMOVE = $F009;
begin
  if Button = mbLeft then
  begin
    ReleaseCapture;
    Perform(WM_SYSCOMMAND, SC_DRAGMOVE, 0);
  end;
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:09 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