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 PopUp popt falsch (https://www.delphipraxis.net/28514-popup-popt-falsch.html)

citybreaker 25. Aug 2004 17:30


PopUp popt falsch
 
Hallo,

ich habe auf meiner Form ein PopUpMenu alerdings popt es da wo es nicht hin soll.
Mitten auf der Form ist ein Label (Label1) wenn man drauf klickt soll das Menue erscheinen.
Dieses erscheint alerdings ganz oben recht am Bildschrimrand.

Delphi-Quellcode:
  PopUpMenu.PopUp(Label1.Left, Label1.Top);

Vjay 25. Aug 2004 17:33

Re: PopUp popt falsch
 
Delphi-Quellcode:
PopUpMenu.PopUp(Label1.Left+left, Label1.Top+top);
Haut es so ungefähr hin? Dann gibts die 100%ig stimmende lösung :) Das label.left/top gibt nämlich nur die relative Position zum Form an, aber nicht die auf dem screen.

sakura 25. Aug 2004 17:42

Re: PopUp popt falsch
 
Sauberer geht es so:
Delphi-Quellcode:
var
  P: TPoint;
begin
  with Label1 do
    P := ClientToScreen(Point(Left, Height));
  PopUpMenu.PopUp(P.X, P.Y);
end;
...:cat:...

HW764 25. Aug 2004 18:08

Re: PopUp popt falsch
 
poppen schreibt man mit 2 P

citybreaker 25. Aug 2004 18:35

Re: PopUp popt falsch
 
Danke, klappt jetzt wunderbar.

:dp:


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