ContextMenuStrip
(1)
MyContextMenuStrip
(1)
MousePoint
(1)
MouseEventArgs
(1)
MouseDown
(1)
PointToScreen
(1)
MouseButtons
(1)
_MouseClick
(1)
Initial Position of Contextmenu
Asked By unk
25-Jan-07 04:06 AM
Hi,
In the documentation I read that a ContextMenu appears at the mouse position
when the user clicks the right mouse button. So far so good. In my situation,
however the menu pops-up at a random position, and when I release the mouse
button it get's positioned at the correct place.
I have no clue why ... can anyone give me a hint?
To show the control I use the following statement;
MyContextMenuStrip.Show(mousePoint)
--
It''s Software Jim, but not as we know it!
Hi,I performed a test based on your description but couldn't reproduce your
Asked By v-lli
25-Jan-07 09:38 PM

Hi,
I performed a test based on your description but couldn't reproduce your
problem.
I create a WinForm application project and add a ContextMenuStrip on the
form. I handle the Form's MouseClick event and in the event handler, I add
the following code.
void Form1_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
this.contextMenuStrip1.Show(this.PointToScreen(e.Location));
}
}
Build the project and run it. When I click the right mouse button on the
form, no context menu strip appears. Only after I release the right mouse
button, the context menu strip pops up at the correct position. All works
fine.
Could you tell me in which event handler you call the statement
'MyContextMenuStrip.Show(mousePoint)'?
Sincerely,
Linda Liu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Hi Linda,I am using VB but your example runs fine at my computer too.
Asked By unk
29-Jan-07 02:57 AM
Hi Linda,
I am using VB but your example runs fine at my computer too. Although I am
using the MouseDown event, the result is what one would expect. So there must
be something else that is causing the behaviour.
It probably has to do with the control I am using (an Infrasgistics grid
control). I am setting the control's ContextMenuStrip attribute to the
correct strip, and then catch the MouseDown event for the control.
I'll setup a small test app and see when and where things go wrong
--
It''s Software Jim, but not as we know it!
Hi,I can confirm it is an issue with the control on the form.
Asked By unk
30-Jan-07 02:51 AM
Hi,
I can confirm it is an issue with the control on the form. Infragistics is
now working on it.
Apologies, should have tried a simple example first, like you suggest,
before putting it up here.
TnX for your help Linda
--
It''s Software Jim, but not as we know it!
Hi,No problem. You're welcome!
Asked By v-lli
30-Jan-07 03:44 AM
Hi,
No problem. You're welcome!
If you have any other questions in the future, please don't hesitate to
contact us. It's always our pleasure to be of assistance!
Sincerely,
Linda Liu
Microsoft Online Community Support
einem Kontextmen? erstellt. private void Form1_Load(object sender, EventArgs e) { ContextMenuStrip contextMenuStrip = new ContextMenuStrip(); contextMenuStrip.Items.Add("Mache"); dataGridView1.ContextMenuStrip = contextMenuStrip; } Mit einem Button will ich das Kontextmen? unsichtbar setzen. private void button1_Click(object sender, EventArgs e) { dataGridView1.ContextMenuStrip.Visible = false; } Das funktioniert aber nicht! Deaktivieren funktioniert : dataGridView1.ContextMenuStrip.Enabled = false; Was mache ich falsch mit .Visible = false;, oder ich ansonsten das Kontextmen? deaktivieren? Alexander Hallo Alexander, Weise dem ContextMenuStrip null zu, wenn Du keines sehen willst, und Dein eigenes Visible, was von ToolStripDown vererbt wird, wirkt nicht bei einem ContextMenuStrip, und ist nur wirksam bei untergeordneten Elementen. Gru? Elmar keywords
NET Framework ContextMenuStrip with a ContextMenuStrip Child i have a menu system that is generated dynamically astetic. . . . I click on a menu item that displays a ContextMenuStrip Popup Menu If an item on that ContextMenuStrip calls another ContextMenuStrip, i want the original ContextMenuStrip to stay visible until a choice is made on the second ContextMenuStrip. vb 2005 .net 2.0 suggestions? more simply. . . . if i click on an item in a ContextMenuStrip, how do i keep the ContextMenu from going away until i want it to? keywords: ContextMenuStrip, with, a, ContextMenuStrip, Child description: i have a menu system that is generated
NET Framework listview & contextMenuStrip I have contextMenuStrip that needs to be shown when my listview item is right-cliked. . I've set the contextMenuStrip property of listview to a contextMenuStrip that I created and when I run the program, right are there locks on the door? —Nick Featherman keywords: listview, &, contextMenuStrip description: I have contextMenuStrip that needs to be shown when my listview item is right-cliked. . I've set the contextMenuStrip property of listview to a contextMenu
NET Framework ContextMenuStrip Click Event. Hi, I have same contextmenuStrip used on two grids. On the click event of this contextMenuStrip, I want to know which grid is it, before proceeding Click Event Handler method of the control. Regards, Sugandh keywords: ContextMenuStrip, , Click, Event. description: Hi, I have same contextmenuStrip used on two grids. On the click event of this contextMenuStrip, I want to know which grid is it, before proceeding
NET Framework notifyIcon und contextMenuStrip hallo! ich habe ein notifyIcon und contextMenuStrip, welches mit dem notifyIcon verbunden ist. ich möchte bei bestimmten situationen aus dem programm heraus, das contextMenuStrip anzeigen, so als ob der benutzer das notifyIcon mit der rechten maustaste angeklickt hat. das contextMenuStrip soll sich aber nach einer definierte zeit wieder schliessen. wie etwas ereichen? danke für die hilfe! Wojtek keywords: notifyIcon, und, contextMenuStrip description: hallo! ich habe ein notifyIcon und contextMenuStrip, welches mit dem notifyIcon verbunden ist. ich möchte bei bestimmten
NET Framework ContextMenuStrip Hola, estoy usando visual basic 2008, tengo 5 picturebox, y a cada de uno le asocio un mismo contextmenustrip. Como hago para saber de que picturebox estoy llamando al contextmenustrip???. Saber de que picturebox active el contextmenustrip. Les agradercia sus comentarios. Hola Miguel, puedes guardar en una Handles ContextMenuStrip1.Opening temporal = (DirectCast(DirectCast(sender, System.Windows.Forms.ContextMenuStrip).SourceControl, System.Windows.Forms.Control).Name) End Sub Private Sub el control llamado:" + temporal) End Sub Gracias funciono correctamente!!! keywords: ContextMenuStrip description: Hola, estoy usando visual basic 2008, tengo 5 picturebox, y a cada de uno le asocio un mismo contextmenustrip. Como hago para saber de que picturebox esto
NET Framework ContextMenuStrip steals focus? Hello All, I have a small problem. I have a RichTextBox, which calls a ContextMenuStrip, when a user types certain text. The problem I am the focus (keyboard input, etc.) to the RichTextBox, once the ContextMenuStrip opens. When the ContextMenuStrip opens, I'd like the keyboard input to continue for Intellisense? Same idea here. Intellisense is nothing more than a ContextMenuStrip (or something akin to it), which pops up when you can continue typing in the text editor even when the ContextMenuStrip is open. Perhaps I am misusing the word focus here saver. Regards, Ryan Thank You for your assistance. -Ryan keywords: ContextMenuStrip, steals, focus? description: Hello All, I have a small problem. I have a RichTextBox, which calls a ContextMenuStrip, when a user types certain text. The problem I am
NET Framework After merging 2 ContextMenuStrip how to call Opening ? Hello All I ve got 2 ContextMenuStrip menu1 : _A _B menu2 : _C _D I set Opening on now I want to merge these 2 menus into one : ContextMenuStrip newMenu = new ContextMenuStrip(); ToolStripManager.Merge(menu1, newMenu); ToolStripManager.Merge(menu2, newMenu); newMenu.Opening one approach to the latter is to sub-class the ContextMenuStrip class and provide subscribe / unsubscribe methods for the other code provides an exception to this (and most do not, including ContextMenuStrip), you cannot get the event subscription state after the fact you are add / removing handlers. Pete keywords: After, merging, 2, ContextMenuStrip, how, to, call, Opening, ? description: Hello All I ve got 2 ContextMenuStrip menu1 : _A _B menu2 : _C _D I set Opening on