AutoPopup (C++)

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

__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
  PopupMenu1->AutoPopup = false;
}

void __fastcall TForm1::FormMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift,
          int X, int Y)
{
  PopupMenu1->Popup(Left + X, Top + Y);
}

Uses

Personal tools
Assistance