(Gast)
n/a Beiträge
|
Re: Buttonmenü á la Rechtsklick
11. Sep 2003, 01:43
Delphi-Quellcode:
procedure TForm1.FormCreate(Sender: TObject);
begin
PopupMenu1.AutoPopup := False;
Button1.PopupMenu := PopupMenu1;
Button1.OnClick := Button1Click;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
P: TPoint;
begin
if (Sender is TButton) then
with TButton(Sender) do
begin
P.X := Left;
P.Y := Top + Height;
P := Self.ClientToScreen(P);
PopupMenu.Popup(P.X, P.Y);
end;
end;
|
|
Zitat
|