Reputation: 79
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.
Upvotes: 1
Views: 3429
Reputation: 39
If you use the popup of Dexpress
you can call:
procedure TForm1.cxButton1Click(Sender: TObject);
begin
dxBarPopupMenu1.PopupFromCursorPos
end;
Upvotes: 0
Reputation: 30735
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.
Upvotes: 3