Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

How to: Hide ToolStripMenuItems

Hiding menu items is a way to control the user interface of your application and restrict user commands. Often, you will want to hide an entire menu when all of the menu items on it are unavailable. This presents fewer distractions for the user. Furthermore, you might want to both hide and disable the menu or menu item, as hiding alone does not prevent the user from accessing a menu command by using a shortcut key.

To hide any menu item programmatically

  • Within the method where you set the properties of the menu item, add code to set the Visible property to false.

    menuItem3.Visible = false;
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.