1 (edited by derek 2020-11-08 13:00:18)

Topic: Disable rightclick popupmenu

Hello All,
Some help please.
I can disable the popupmenu that is associated with a tablegrid successfully ( form1.tablegrid1.popupmenu := nil; ).
However, when I try to do the same thing with either a memo field or an edit field, it has no effect - the popupmenu still displays..
In the attachment, right-click in the tablegrid and there is no popup - just a message that I want to display.  But right-click in the memo field and the popup still displays first and only after that a message.  Right-click in the edit field and it is the same problem.
Does anyone know how to disable the memo field and edit field popup menus so that they do not display at all?
Thanks,
Derek.

Post's attachments

Attachment icon test.zip 336.02 kb, 234 downloads since 2020-11-08 

Re: Disable rightclick popupmenu

Hello Derek

Can this link help you ?

https://stackoverflow.com/questions/611 … u-of-tmemo

In an old project made with Delphi 7 (it's a long, long, very long time !), I used this snippet to déactivate popmenu fot a TEdit

procedure TForm1.Edit1_MenuPopup(    Sender: TObject;    MousePos: TPoint;    var Handled: Boolean) ;
begin
                       
    Handled := True;   // désactiver le menu popu du TEdit
end;

Regards

JB

Re: Disable rightclick popupmenu

Salut Jean,
J'espère que tu et ta famille allez bien.
Thanks for your help - it's now working exactly as I want it - perfect!.
I owe you one.
Derek.