[2005] MDI & MDI Child Forms Menu's in VB2005
Hi,
How Do You Coordinate MDI & MDI Child Forms Menu's in VB2005
In VB6 when you launced a MDI Child form, it's menu would appear in it's MDI Form's menu space. NOW, it Adds to the MDI Forms Menu Area.
How can I Turn Off the MDI Form Menu before Launching the MDI Child Form?
Remember, I want to restore it when returning from the Child Form Back to the MDI Main Form.
Re: [2005] MDI & MDI Child Forms Menu's in VB2005
In .net mdi child menus should merge with the parent menus rather than just replace them. Look at the AllowMerge Property of the menu strip and the MergeAction and MergeIndex properties of the individual menu items.
HTH
kevin
Re: [2005] MDI & MDI Child Forms Menu's in VB2005
Hi,
I done this example and after i run this:
For Each menuItem As ToolStripMenuItem In MenuStrip.Items
menuItem.Enabled = False
menuItem.Visible = False
Next
Still when i click a shortcut that i have in this menu it still working the short cut.
How can i prevent that this menu can't work?
Re: [2005] MDI & MDI Child Forms Menu's in VB2005
well I don't know.... Are you merging menu's? If so, disabling menu items on the main form does not disable any merged menus that are contain by a child form.
kevin
Re: [2005] MDI & MDI Child Forms Menu's in VB2005
Hi,
I am not merging menu's.
Re: [2005] MDI & MDI Child Forms Menu's in VB2005
Quote:
Originally Posted by yulyos
Hi,
I done this example and after i run this:
For Each menuItem As ToolStripMenuItem In MenuStrip.Items
menuItem.Enabled = False
menuItem.Visible = False
Next
Still when i click a shortcut that i have in this menu it still working the short cut.
How can i prevent that this menu can't work?
I am a bit confused at this point. If you are setting the menu visible property to false, then how can you click on the menu?
If however you are trying access the menu's click event from somewhere else in the code, then disabling the object and setting the visible property to false does not disable the routine that gets run when the event occurs, it simply allows the event to never occur.
kevin
Re: [2005] MDI & MDI Child Forms Menu's in VB2005
Hi,
For Each menuItem As ToolStripMenuItem In MenuStrip.Items
menuItem.Enabled = False
menuItem.ShortcutKeys = False
Next
I'm useing Shortcut Ctrl+Z
Re: [2005] MDI & MDI Child Forms Menu's in VB2005
ok..I understand now....
Just by disabling the top level menu item, does not disable the child menu item. You need to disable the menus sub items as well.
kevin
Re: [2005] MDI & MDI Child Forms Menu's in VB2005
Hi,
How can I do it?
Can you send an example?
Re: [2005] MDI & MDI Child Forms Menu's in VB2005
It's just like disabling any other menu item. If the name of the item is SubMenuItem then use
Code:
SubMenuItem.enable=false
kevin
Re: [2005] MDI & MDI Child Forms Menu's in VB2005
Hi,
How I add to the next code that also SubItems in the MenuStrip will be Enabled = False
For Each menuItem As ToolStripMenuItem In MenuStrip.Items
menuItem.Enabled = False
Next