[Mono-dev] ContextMenuStrip Work incorrectly

Jonathan Pobst monkey at jpobst.com
Mon Apr 6 10:04:47 EDT 2009


Hey!

Can you please file this in our bugzilla so we can track it?

http://www.mono-project.com/Bugs

Thanks!
Jonathan

jingnan si wrote:
> Hi,
>   When the context menu contains ToolStripDropDownItem and a normal 
> ToolStripItem, the normal ToolStripItem will not function after the 
> ToolStripDropDown show and hide, I have attached the simple test 
> project. Just right click on the form and bring up the context menu.
>   I am using the lastest code from svn.
>   After some research, I create a simple fix to make the ToolStripItem 
> Work, but I don't think the fix solved the bug, it just solved my 
> program, please find the diff below.
> 
> Best Regards,
> Jingnan Si
> 
> Index: class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs
> ===================================================================
> --- class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs   
> (Version 131066)
> +++ class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs   
> (Work copy)
> @@ -1521,6 +1521,12 @@
>             foreach (ToolStripItem tsi2 in this.Items)
>                 if (tsi != tsi2)
>                     tsi2.Dismiss (ToolStripDropDownCloseReason.Keyboard);
> +
> +           if (Application.KeyboardCapture != this) {
> +               Application.KeyboardCapture = this;
> +           }
> +
> +           KeyboardActive = true;
>         }
> 
>         internal virtual bool OnMenuKey ()
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list



More information about the Mono-devel-list mailing list