Windows Develop Bookmark and Share   
 index > Windows Forms General > Re:Mdi Form
 

Re:Mdi Form

Hi All

I am using Visual studio 2005(c#) for creating my windows application. In my parentform (i.e. Mdi container)I am using menu strip control. when i am clicking menu strip, child window is loading on parent window and I am disabling menu strip,up to this its working fine. The problem is when I am closing the child window by using the click event of the button which is in child ,I am struggling to enable the menu strip in the parent window. Any one helps me solve this.

ganeshkuppuswamy  Tuesday, November 06, 2007 6:28 AM
Hi, ganeshkuppuswamy,

Based on my understanding, you want to enable the MenuStrip in the MdiParent form when closing your Child Form, don't you?

It is possible with a public MenuStrip.

First, please change the modifier of your MenuStrip to public through Properties window.
Then, you can use the following codes to enable it in your Child Form.
Code Block

private void button1_Click(object sender, EventArgs e)

this.MdiParent as MDIMain).menuStrip1.Enabled = true;

this.Close();

Hi, ganeshkuppuswamy,

Based on my understanding, you want to enable the MenuStrip in the MdiParent form when closing your Child Form, don't you?

It is possible with a public MenuStrip.

First, please change the modifier of your MenuStrip to public through Properties window.
Then, you can use the following codes to enable it in your Child Form.

Code Block

private void button1_Click(object sender, EventArgs e)

this.MdiParent as MDIMain).menuStrip1.Enabled = true;

this.Close();

HI friend

Thank you for your great help. This code is the one which I expected.

ganeshkuppuswamy  Monday, November 12, 2007 4:55 AM

You can use google to search for other answers

Custom Search

More Threads

• Combo Box freezing the application
• Problem transferring an image to external application using the clipboard.
• VB2005 Report (rdlc) programmaticaly modify Header data
• ProgressBar acting strange.
• Saving stateof a Class that is extending Control Class
• Full screen is not full screen
• Attachment Field in Access 2007
• ErrorProvider ICON Change Only Shows Resource Template
• Layout: FlowLayoutPanel
• Can you force a brush to paint over existing controls