473,387 Members | 1,431 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,387 software developers and data experts.

Enable\Disable menus of MDI Parent

Hi,
I have an C# MDI application. There are three mdi childs, mdiFormA, childB and childC. childA is loaded in the parent by default as below:
private void TestingMenu_Load(object sender, EventArgs e)//mdiParent load
{

mdiFormA objA = new mdiFormA();
objA.MdiParent = this;
objA.Show();
//this.formAToolStripMenuItem.Enabled = false;

}

mdiFormA can also be opened from the menustrip menu as:
private void formAToolStripMenuItem_Click(object sender, EventArgs e)
{

if (!menuEnabler.ParentIsActive)
{
mdiFormA objA = new mdiFormA();
objA.MdiParent = this;
objA.Show();
//this.formAToolStripMenuItem.Enabled = false;
}
else
{
//this.formAToolStripMenuItem.Enabled = true;
}
}
Similarly mdiFormB and mdiFormC can also be opened from the menu_clicks.

What I need to do is when the application is launched and mdiFormA is successfully loaded, the menu item to open mdiFOrmA bcomes disabled and at this instant menu items for childs A and B becomes enabled. When mdiFormA is closed/disposed, the menu item to open mdiFormA becomes enabled but the menu itms to open mdiFormB and mdiFormC becomes disabled.

I have tried to implement this mechanism by making all the menus of parent public and then doing something like this in mdiFormA:
TestingMenu obj = new TestingMenu();
obj.formAToolStripMenuItem.Enabled = false;
obj.formCToolStripMenuItem.Enabled = true;
obj.formCToolStripMenuItem.Enabled = true;
Apr 4 '07 #1
1 1892
Continuing from my last post:
This doesn't work as I think this is not a correct approach but since I am new to programming I can't figure out how to make this working. I think I can do some event driven programming to implement this. The user wants to have exactly this type of fucntionality like visually see the disabled menus.

Please anyone, any help is welcomed.
Thanks.
Apr 4 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Larry R Harrison Jr | last post by:
I have them working now, courtesy of the link given in the prior thread--the HVMenu over at Dynamic Drive myself. http://www.dynamicdrive.com I have them working as side-bar menus, not...
3
by: Steven Smith | last post by:
the way I'm undersatnding the MSDN documentation when creating parent and child forms the main menu for the child form should not be displayed on the child form itself but instead be incorporated...
0
by: mlg1906 | last post by:
I am developing an intranet site that uses 3 menus. Menus 1 and 2 are horizontal menus at the top of my page. The 3rd menu is a vertical menu on the left. All of the possible nodes have been loaded...
0
by: mlg1906 | last post by:
I am developing an intranet site that uses 3 menus. Menus 1 and 2 are horizontal menus at the top of my page. The 3rd menu is a vertical menu on the left. All of the possible nodes have been loaded...
2
by: Tom Costanza | last post by:
For the life of me, I can't seem to merge main menu items from child to parent with MDI forms. I can merge sub-menus, but not main menu items. So I have a parent form with: File Windows Help...
4
by: Gigs_ | last post by:
class MenuDemo(Frame): def __init__(self, parent=None): Frame.__init__(self, parent) self.pack(expand=YES, fill=BOTH) self.createWidgets() def createWidgets(self): self.makeMenuBar()...
11
by: Nospam | last post by:
I don't know what it is I am doing wrong, I am trying to get the menus to either expand or contract based on their previous states, i.e if already expanded if clicked again contract, and if...
55
by: rhino | last post by:
I need to learn more about making two kinds of menus: A. menus that have hierarchies of three or four levels B. horizontal menus that have so many options that they are wider than the available...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.