Prevent popup menu on grid

How can I prevent when a user right clicks on a grid to activate my popup menu ?
I would like that option only on form itself and not on components..
BosanacAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ziolkoCommented:
>>How can I prevent when a user right clicks on a grid to activate my popup menu ?

don't assign PopupMenu property

>>I would like that option only on form itself and not on components

eventually you can turn off .AutoPopup and trigger menu by .Popup() function

ziolko.
0
Lester_ClaytonCommented:
Create a new popup menu that has no menu items, and assign that new popup menu to the grid.  Problem solved.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ziolkoCommented:
>>Create a new popup menu that has no menu items, and assign that new popup menu to the grid

isn't it simpler not to assign popup menu to grid at all?

ziolko.
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

mikelittlewoodCommented:
Either remove the popup menu at design time, or based on some security of the currently logged on user do it in code

procedure TForm1.FormCreate(Sender: TObject);
begin
   if not canUsePopup then
      DBGrid1.PopupMenu := nil
end;
0
Lester_ClaytonCommented:
zioko : The author has a popup menu assigned to his form.  If he has no popup assigned to his other components, the form's popup will be effective when he right clicks.  He wants there to be no popup menu when he right clicks his grid component.

Ideally, he should not have a popup assigned to his form but only to the components where he wants the popup to work, but I'm not here to define his best practices, I've just helped him with a solution.
0
ziolkoCommented:
>>The author has a popup menu assigned to his form.

ooops my mistake
0
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.