* Merge winforms framework content to working branch (#14) * Breadcrumb / TOC / Move net5 to net folder (#15) * change path from net5 to net * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Add .net 5 winforms placeholder article (#16) * added some metadata and adjusted net5 placeholder * corrections * corrections * corrections * Test1 * Swapping landing page vs concept * fix links * Fix links * Fix desc
2.0 KiB
title, ms.date, helpviewer_keywords, ms.assetid
| title | ms.date | helpviewer_keywords | ms.assetid | ||||
|---|---|---|---|---|---|---|---|
| How to: Disable ToolStripMenuItems Using the Designer | 03/30/2017 |
|
985e311e-7d67-4205-b5a3-d045b68a4a03 |
How to: Disable ToolStripMenuItems Using the Designer
You can limit or broaden the commands a user may make by enabling and disabling menu items in response to user activities. Menu items are enabled by default when they are created, but this can be adjusted through the xref:System.Windows.Forms.ToolStripMenuItem.Enabled%2A property. You can manipulate this property at design time in the Properties window or programmatically by setting it in code. For more information, see How to: Disable ToolStripMenuItems.
To disable a menu item at design time
-
With the menu item selected on the form, set the xref:System.Windows.Forms.ToolStripMenuItem.Enabled%2A property to
false.Tip
Disabling the first or top-level menu item in a menu disables all the menu items contained within the menu. Likewise, disabling a menu item that has submenu items disables the submenu items. If all the commands on a given menu are unavailable to the user, it is considered good programming practice to both hide and disable the entire menu, as this presents a clean user interface. You should both hide and disable the menu, as hiding alone does not prevent access to a menu command via a shortcut key. Set the xref:System.Windows.Forms.ToolStripItem.Visible%2A property of a top-level menu item to
falseto hide the entire menu.