方法1
procedure TForm2.Button1Click(Sender: TObject); var Pt: TPoint; begin GetCursorPos(Pt); PopupMenu1.Popup(Pt.X, Pt.Y); end;
方法2
设置控件的DropDownMenu 为右键单击(可手动设置) 这个功能只对ToolBar的 Button有效
PopMenu为右键单击
procedure TForm1.Button1Click(Sender: TObject); begin ToolButton1.DropdownMenu := PopupMenu1; end;