473,802 Members | 2,468 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 ContextMenuStri p as -

ContextMenuStri p1.Items.Item(N ame).Enabled = False

but MenuStrip1.Item s.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 18511
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 ContextMenuStri p as -

ContextMenuStri p1.Items.Item(N ame).Enabled = False

but MenuStrip1.Item s.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 "ToolStripMenuI tem". In your case, your object may be
named "OpenToolStripM enuItem". You can simply set OpenToolStripMe nuItem.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 ContextMenuStri p as -

ContextMenuStri p1.Items.Item(N ame).Enabled = False

but MenuStrip1.Item s.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 "ToolStripMenuI tem". In your case, your object
may be named "OpenToolStripM enuItem". You can simply set
OpenToolStripMe nuItem.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
21685
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 items that don't do anything. MDI Container.IsMdiContainer = true MenuStrip.AllowMerge = true /// First menu items this.miFile.MergeAction = System.Windows.Forms.MergeAction.Insert;
0
2971
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 populates the MenuStrip control. The MainMenu is from legacy 2003 and works fine. I want to upgrade to the MenuStrip but cannot find a way to duplicate legacy code. Shown below is my best effort. I am having two problems. #1: ToolStripMenuItem...
6
34688
by: Luqman | last post by:
How can I dynamically Add menuStrip and its menuItems through code using VB.Net 2005 ? Best Regards, Luqman
0
1739
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 contentmenustrip to a menustrip, but what I need to do is have the items in both places. I did see where it was said that a contexmenu can be used in multiple places. But I wonder if that means that multiple controls can reference the same contextmenustrip....
0
5058
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. The Load menu is to list all the saved reports. I need to refresh the Load menu after a new report is saved. Any help is much appreciated! Code:
0
1151
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 application startup, toolbar should created automatically from specified menu items. Users can select the menu items which are available in toolbar. Anu idea how to implement such toolbar ?
1
2360
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 me. Thank you
2
2974
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 menus to get their items and .text field. Any help.... Brian
3
7839
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 decided I wanted to add a little icon next to the status text, so I opened up the image property in Design mode and imported 2 images. Both were PNG images and were 256x256 resolution. I decided that I wanted to use smaller versions since it was, after...
0
9562
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10535
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10303
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10061
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9111
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7598
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2966
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.