如何在 cxbutton (devexpress Delphi) 中使用左键单击显示弹出菜单?

How to show the popup menu using left click in cxbutton (devexpress Delphi)?

我有一个附加到 cxbutton 的弹出菜单(Delphi 的 devexpress 组件),鼠标右键单击显示菜单,但现在我需要通过鼠标左键单击它。

请问我检查了 cxbutton 的所有属性,但似乎没有人这样做,怎么办?

我正在使用 Delphi 7.

你试过了吗:

procedure TForm1.cxButton1Click(Sender: TObject);
begin
  PopUpMenu1.Popup(Mouse.CursorPos.X, Mouse.CursorPos.Y);
end;

?对我来说,这在 D7 中有效,如果右键单击,PopUpMenu 会出现在同一位置。

如果你使用Dexpress的弹窗,你可以调用:

procedure TForm1.cxButton1Click(Sender: TObject);
begin
   dxBarPopupMenu1.PopupFromCursorPos
end;