473,386 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

MenuStrip Submenu Items

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
2 18412
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: John J. Hughes II | last post by:
Could someone explain how to merge the form menu with the mdi container window. The menu strip items on the form window merge but I either end up with a blank blue menu on the form or top list of...
0
by: genojoe | last post by:
Included below are four methods and a Friend that can be inserted directly into a form that already contains Button1, Button2, and MenuStrip1. Button1 populates the MainMenu control, button2...
6
by: Luqman | last post by:
How can I dynamically Add menuStrip and its menuItems through code using VB.Net 2005 ? Best Regards, Luqman
0
by: active | last post by:
For the last 3 or 4 days I've been, on an off, searching the Internet and theVS2005 Doc for an example of how to add a contextmenustrip to a menustrip. I can move all the items from a...
0
by: kyungdongkim | last post by:
Hi, I have a dynamically generated MenuStrip following this example: http://www.codeproject.com/useritems/Dynamic_MenuStrip.asp Basically the menu strip allows users to save and load reports. ...
0
by: Andrus | last post by:
WinForms MDI parent form menu system (MenuStrip and ToolStripMenuItem's) created in designer using MenuStrip. ToolStripMenuItems items have text, image properties and onclick event set. At...
1
by: Amish kapadiya | last post by:
I disabled menustrip sub menu item when user click on perticular submenu. I can not enable those menu items from child page. I want to know, how to enable menustrip item from child page Please ans...
2
by: Brian | last post by:
Hi, I have a menustrip that has 3 main menus and various number of menus below them... I am trying to figure out how i can loop through the main menus and then loop through each one of the main...
3
HaLo2FrEeEk
by: HaLo2FrEeEk | last post by:
Ok, I have a menuStrip and a toolStrip. the menuStrip is laid out like this: Actions Connect Disconnect - Exit Pretty simple. The toolstrip has 1 item, a toolstripstatus. I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.