MenuStrip Submenu Items

S

ShaneO

Probably a stupid question, but I can't seem to find how to
Enable/Disable Submenu items within a MenuStrip.

File
-Open
-Save
..
..


I know how to do it in a ContextMenuStrip as -

ContextMenuStrip1.Items.Item(Name).Enabled = False

but MenuStrip1.Items.Item("Open").Enabled = False doesn't work.

Any help appreciated.

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
 
J

Jim Wooley

Hello ShaneO,
Probably a stupid question, but I can't seem to find how to
Enable/Disable Submenu items within a MenuStrip.

File
-Open
-Save
.
.
I know how to do it in a ContextMenuStrip as -

ContextMenuStrip1.Items.Item(Name).Enabled = False

but MenuStrip1.Items.Item("Open").Enabled = False doesn't work.

Each MenuStrip item is declared as it's own entity. By default it takes the
name of the Text and "ToolStripMenuItem". In your case, your object may be
named "OpenToolStripMenuItem". You can simply set OpenToolStripMenuItem.Enabled=False.

Jim Woole
 
S

ShaneO

Jim said:
Hello ShaneO,



Each MenuStrip item is declared as it's own entity. By default it takes
the name of the Text and "ToolStripMenuItem". In your case, your object
may be named "OpenToolStripMenuItem". You can simply set
OpenToolStripMenuItem.Enabled=False.

Jim Wooley
Hello Jim,

Thank-you very much for your assistance. As I thought, it was stupid
question, but I just couldn't see the forest for the trees! (You
wouldn't believe how long I spent on this, and all the Googling in the
world didn't seem to help!!!)

Thanks again.

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top