0
votes

I have a popup menu attached to a cxbutton (devexpress component for Delphi), the right mouse click shows the menu but now i need it by the left mouse click.

Please i checked all properties of the cxbutton but no one seems to do so, how to do ?

I m using Delphi 7.

2

2 Answers

2
votes

Have you tried:

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

? For me, this works in D7 and the PopUpMenu appears at the same position is if it were right-clicked.

0
votes

If you use the popup of Dexpress you can call:

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