RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TPopupMenu.Popup Method

Displays the pop-up menu onscreen.

Pascal
procedure Popup(X: Integer; Y: Integer); virtual;
C++
virtual __fastcall Popup(int X, int Y);

Call Popup to bring up the pop-up menu. The menu appears at the screen coordinates indicated by the values (in pixels) of X and Y.  

Delphi Examples: 

 

{
This example uses a pop-up menu. When the user presses the
mouse button, the pop-up menu appears where the user
clicked the mouse:
} 
procedure TForm1.FormCreate(Sender: TObject);
begin
  PopupMenu1.AutoPopup := False;
end;

procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  PopupMenu1.Popup(Left + X, Top + Y);
end;

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!