how to disable menu strip sub items in vb.net application.

Set the property of sub menu item - Enabled=False

in coding i'm writing like this it gives an error

menustrip.Item(2) '' is the second one tab i.e. Edit and in edit i want to disable redo control .

what to do after that

You need to typecast the menu collection item.

CType(MenuStrip1.Items(1), ToolStripMenuItem).DropDownItems(1).Enabled = False

Thanks it works

but if i have one more tab inside on like
edit--> Redo--> my control to disable so what to do?

The same way as in post #4

CType(CType(MenuStrip1.Items(0), ToolStripMenuItem).DropDownItems(2), ToolStripMenuItem).DropDownItems(1).Enabled = False
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.