By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,579 Members | 1,618 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,579 IT Pros & Developers. It's quick & easy.

MenuStrip Submenu Items

P: n/a
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.
Feb 9 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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 Wooley
Feb 9 '06 #2

P: n/a
Jim Wooley wrote:
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 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.
Feb 9 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.