Disable menu items in Windows Forms ContextMenuStrip (ContextMenuStripEx)

9 Jun 20211 minute to read

We can disable the unused or unsupported menu items by using this feature. ToolStripItems are enabled by default when they are created, but this can be changed based on user requirement through the Enabled property.

The below code snippet will explain how to disable the ToolStripItems.

this.toolStripMenuItem1.Enabled = false;
this.toolStripTextBox1.Enabled = false;
this.toolStripComboBox1.Enabled = false;
Me.toolStripMenuItem1.Enabled = False
Me.toolStripTextBox1.Enabled = False
Me.toolStripComboBox1.Enabled = False

Disable menu items