Topic: Diable pop-up menu

Hello people from DriveSoft. Is it possible to disable the pop-up menu when the right mouse button is pressed. It appears by example when the right mouse button is pressed in a tablegrid.

2 (edited by derek 2019-08-19 15:22:46)

Re: Diable pop-up menu

Hi Kees,
Try putting this code in the final section of your script
begin
  form1.tablegrid1.dbpopupmenu.items[0].Enabled := false;   //** where items[0] is the 1st item in the popup list, items[1] is the 2nd item etc etc
end.
If you prefer not to see 'Show Record' grayed out, you can make it invisible like this -
begin
  form1.tablegrid1.dbpopupmenu.items.items[0].Visible := false;
end.
Another way of doing it is to find the text of the item you're trying to disable rather than by using items[0]
begin
  form1.tablegrid1.dbpopupmenu.Items.find('Show Record').enabled := false;
end.   
Please see attached.
Derek.

Post's attachments

Attachment icon keespopup.zip 334.95 kb, 300 downloads since 2019-08-19