473,569 Members | 2,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple context menu problem

What's wrong with the context menu?

I have created one for the DataGrid control and showing it like this:

private void dataGrid_MouseU p(object sender,
System.Windows. Forms.MouseEven tArgs e)
{
if( e.Button == MouseButtons.Ri ght)
{
if( dataGrid.Contex tMenu != null )
dataGrid.Contex tMenu.Show(data Grid, new Point(e.X, e.Y) );
}
}

The menu is displayed but I need to click TWICE to dismiss it!
Is it intended to be like that?
Nov 16 '05 #1
2 4488
Never mind,
I just removed the right mouse click handler and everything is fine.
"Striped" <skovbasa[aatt]insycom.net> wrote in message
news:eX******** ******@tk2msftn gp13.phx.gbl...
What's wrong with the context menu?

I have created one for the DataGrid control and showing it like this:

private void dataGrid_MouseU p(object sender,
System.Windows. Forms.MouseEven tArgs e)
{
if( e.Button == MouseButtons.Ri ght)
{
if( dataGrid.Contex tMenu != null )
dataGrid.Contex tMenu.Show(data Grid, new Point(e.X, e.Y) );
}
}

The menu is displayed but I need to click TWICE to dismiss it!
Is it intended to be like that?

Nov 16 '05 #2
"Striped" <skovbasa[aatt]insycom.net> wrote in message
news:eX******** ******@tk2msftn gp13.phx.gbl...
What's wrong with the context menu?

I have created one for the DataGrid control and showing it like this:

private void dataGrid_MouseU p(object sender,
System.Windows. Forms.MouseEven tArgs e)
{
if( e.Button == MouseButtons.Ri ght)
{
if( dataGrid.Contex tMenu != null )
dataGrid.Contex tMenu.Show(data Grid, new Point(e.X, e.Y) );
}
}

The menu is displayed but I need to click TWICE to dismiss it!
Is it intended to be like that?


I believe that once the menu is assigned to the DataGrid's ContextMenu
property it will automatically be popped up in response to a right-mouse
click, so you don't need to handle the MouseUp event and show the menu
yourself.(I admit that this is NOT what the online help says, but it seems
to work!)

Chris Jobson
Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4760
by: Eddie de Bear | last post by:
Hi, A project I am working on has a requirement for dynamic menus. For the most part this works really well. The menus I'm creating a based on files and directories, so naturally the menu creation takes some time. The approach I took was to override the OnSelect method of the MenuItem class, which had code to populate the
4
3028
by: Mohit Gupta | last post by:
Hi all, Lately I have been working on an application in VB .net CF for Pocket PC device. I have a small question about Context Menu. When I try to close the window after context menu is poped up, the window does not closes until I click on the window. Below is the code. Hopefully, you can help me out.
2
2500
by: Eric | last post by:
I implemented owner drawing on the main and context menus of my main form. It works fine. There is also a notify icon control that has a context menu. When the icon is in the status bar, it works perfectly fine when it is double-clicked. However, when I try to initialize the notify icon's context menu as an owner-drawn menu, all the text...
0
1564
by: VP | last post by:
G'day folks, well i am attempting to get an understanding on how to create the menuitems in a context menu on the fly. So far I have managed to actually achieve the menu items being created for the context menu. However, I have stumbled across one problem. Which is that how does one go about enhancing the event handler for the context menu...
2
1629
by: Dino M. Buljubasic | last post by:
I have several context menus added to my form. The form is displaying items in listviews connected to the context menus. When I click on an item in a list view, a popup context menu shows allowing me to chese between editing or deleting the item from the list view. That works fine. However, in addition to calling the context menu on Click,...
0
1554
by: tony.spalding | last post by:
I'm having a problem trying to add a link to my add-in to a context menu. I'm trying to add it to the context menu that you get when you right click on a stored procedure within the Server Explorer and there are a number of problems that I've hit. I'm using VS.NET2005 and am trying to debug the add-in, so when running it it loads up another...
4
3954
by: Fred | last post by:
Hi, I have a list box with a context menu. When I right click the menu appears as expected. However when I select an option on the context menu the menu does not close. The click event on the menu is fired but the menu remains. Is there anyway I can get this menu to close when I select a menu option?
2
5895
by: MCM | last post by:
I'm working on a plotting control. The plotting control will have a context menu with basic commands for "scaling", "zooming", etc. Is there a way that, from the parent form, I can add more commands to the control's context menu? I'm envisioning a case where the control has a set of context menu items, and the parent form also has a set...
3
5029
by: Poggs | last post by:
Hi everyone, I used the pattern for Shell Extensions for Context menu from Dino Esposito's article. However I implemented it in more than one application and it seems that those two right click functionalities cannot work together. void IContextMenu.InvokeCommand (IntPtr pici) I put more debugging information and I noticed that the two...
0
7922
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8119
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6281
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.