AutoPopup (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This example uses a pop-up menu. When you press the mouse button, the pop-up menu appears where you clicked the mouse.

Code

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;

Uses