?
Solved

Prevent popup menu on grid

Posted on 2008-01-25
8
Medium Priority
?
724 Views
Last Modified: 2010-05-18
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..
0
Comment
Question by:Bosanac
7 Comments
 
LVL 21

Expert Comment

by:ziolko
ID: 20743292
>>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
 
LVL 9

Accepted Solution

by:
Lester_Clayton earned 200 total points
ID: 20743445
Create a new popup menu that has no menu items, and assign that new popup menu to the grid.  Problem solved.
0
 
LVL 21

Expert Comment

by:ziolko
ID: 20743523
>>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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 15

Expert Comment

by:mikelittlewood
ID: 20743794
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
 
LVL 9

Expert Comment

by:Lester_Clayton
ID: 20743830
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
 
LVL 21

Expert Comment

by:ziolko
ID: 20744500
>>The author has a popup menu assigned to his form.

ooops my mistake
0
 
LVL 1

Expert Comment

by:Computer101
ID: 21186025
Forced accept.

Computer101
EE Admin
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…

592 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question