473,387 Members | 1,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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_MouseUp(object sender,
System.Windows.Forms.MouseEventArgs e)
{
if( e.Button == MouseButtons.Right)
{
if( dataGrid.ContextMenu != null )
dataGrid.ContextMenu.Show(dataGrid, 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 4480
Never mind,
I just removed the right mouse click handler and everything is fine.
"Striped" <skovbasa[aatt]insycom.net> wrote in message
news:eX**************@tk2msftngp13.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_MouseUp(object sender,
System.Windows.Forms.MouseEventArgs e)
{
if( e.Button == MouseButtons.Right)
{
if( dataGrid.ContextMenu != null )
dataGrid.ContextMenu.Show(dataGrid, 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**************@tk2msftngp13.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_MouseUp(object sender,
System.Windows.Forms.MouseEventArgs e)
{
if( e.Button == MouseButtons.Right)
{
if( dataGrid.ContextMenu != null )
dataGrid.ContextMenu.Show(dataGrid, 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
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...
4
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...
2
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...
0
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...
2
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...
0
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...
4
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...
2
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...
3
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...

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.