MenuStrip may expand the first ToolStripMenuItem for any Access Key

Article ID: 960880 – Last Review: December 4, 2008 – Revision: 1.0

MenuStrip may expand the first ToolStripMenuItem for any Access Key

Source: Microsoft Support

RAPID PUBLISHING

RAPID PUBLISHING ARTICLES PROVIDE INFORMATION DIRECTLY FROM WITHIN THE MICROSOFT SUPPORT ORGANIZATION. THE INFORMATION CONTAINED HEREIN IS CREATED IN RESPONSE TO EMERGING OR UNIQUE TOPICS, OR IS INTENDED SUPPLEMENT OTHER KNOWLEDGE BASE INFORMATION.

Action

You have a MenuStrip Control on a Windows Form. You run the application to display the Windows Form and press the ALT key to Activate the Menu.

Result

Instead of the first top level ToolStripMenuItem getting activated, the ToolStripMenuItem expands. This issue only occurs if you have expanded the ToolStripMenuItem using its access key before and then closed it by clicking on the form. The issue does not occur if you close the ToolStripMenuItem by either clicking on one of the ToolStripMenuItems on the parent ToolStripMenuItem or using the Escape key to dismiss the menu.

A side effect of this problem is that if you have any unassigned access keys, and you use the unassigned access key, the first top level ToolStripMenuItem expands, giving an impression that the access key is assigned to the top level ToolStripMenuItem.

Cause

This is due to a problem in the product.

Resolution

There is no easy way to workaround this issue.

More Information

To reproduce the problem:

1) Open Visual Studio and create a new Windows Forms Application.

2) From the Toolbox, select MenuStrip and drop it on the designer

3) Add a few ToolStripMenuItems to the MenuStrip so that the menu looks like this: &File->&New, &File->&Save, &Edit->&Cut, &Edit->&Paste

4) Run the application.

5) Use the ALT + F access key to expand the File Menu.

6) Now click elsewhere on the form to dismiss the menu.

7) Now press the ALT key, the File Menu should Expand. Simillarly using any unassigned access key for example ALT + X, ALT + Y etc will expand the file menu.

For more information on the MenuStrip see the following article:

http://msdn.microsoft.com/en-us/library/system.windows.forms.menustrip.aspx (http://msdn.microsoft.com/en-us/library/system.windows.forms.menustrip.aspx)

For more information on Access Keys, see the following articles:

http://msdn.microsoft.com/en-us/library/bb226831(VS.85).aspx (http://msdn.microsoft.com/en-us/library/bb226831(VS.85).aspx)

http://msdn.microsoft.com/en-us/library/bb246396(VS.85).aspx (http://msdn.microsoft.com/en-us/library/bb246396(VS.85).aspx)

 

DISCLAIMER

MICROSOFT AND/OR ITS SUPPLIERS MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY, RELIABILITY OR ACCURACY OF THE INFORMATION CONTAINED IN THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED ON THIS WEBSITE (THE “MATERIALS”) FOR ANY PURPOSE. THE MATERIALS MAY INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS AND MAY BE REVISED AT ANY TIME WITHOUT NOTICE.

TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND/OR ITS SUPPLIERS DISCLAIM AND EXCLUDE ALL REPRESENTATIONS, WARRANTIES, AND CONDITIONS WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO REPRESENTATIONS, WARRANTIES, OR CONDITIONS OF TITLE, NON INFRINGEMENT, SATISFACTORY CONDITION OR QUALITY, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE MATERIALS.


APPLIES TO
  • Microsoft .NET Framework 2.0
  • Microsoft Visual Studio 2008 Standard Edition
  • Microsoft Visual Studio 2008 Professional Edition
  • Microsoft Visual Studio Team System 2008 Team Suite
  • Microsoft Visual Studio 2005 Standard Edition
  • Microsoft Visual Studio 2005 Professional Edition
  • Microsoft Visual Studio 2005 Team Suite
Keywords: 
kbnomt kbrapidpub KB960880

 

Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
Microsoft Corporation. All rights reserved. Terms of Use | Trademarks


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

Leave a Reply

*
To prove that you're not a bot, enter this code
Anti-Spam Image