Windows Develop Bookmark and Share   
 index > Windows Forms Designer > MDI form connection in VB.NET
 

MDI form connection in VB.NET

hi, im new to vb.net.. can u plz provide the code to connect child form with mdi parent form... i.e say i have a parent form... when i click the item in the menu in the parent form i must be directed to its corresponding sub form....
xplorsoftware  Monday, July 20, 2009 2:09 PM
Yes of course, my one was an example.
Remember to sign as answer my post if it was useful for you.
MCAD - MCSD MCTS Sharepoint 2007 MCTS SQL Server 2005 http://blog.raffaeu.com "If my answer is useful remember to mark it as useful".
raffaeu_bermuda  Tuesday, July 21, 2009 7:23 PM
First of all you need to create a MDI form.
After you have created a MDI form you have to create a child form and finally, at runtime, load the child.
The code should be something like:

    Dim child As New mdichild()
    child.MdiParent = Me
    child.Show()

Now let's go back to the IDE design and add a menu to the MDI form.
Then add an item to the menu, this item will shows up the MDI child forms.
Finally click on the properties of the menu and select: MDIWindowsListItem and select the item you have created.
That's it!

Remember to mark as correct my answer if it was useful for you.

MCAD - MCSD MCTS Sharepoint 2007 MCTS SQL Server 2005 http://blog.raffaeu.com "If my answer is useful remember to mark it as useful".
raffaeu_bermuda  Monday, July 20, 2009 4:46 PM
hi frnd,
Thank u for helping me.. In the MDI coding that is automatically generated when i click the mdi form i have line as
Dim ChildForm As New System.Windows.Forms.Form
ChildForm.MdiParent = Me

so is childform and child(that u declared) r the same.............?
xplorsoftware  Tuesday, July 21, 2009 1:43 PM
Yes of course, my one was an example.
Remember to sign as answer my post if it was useful for you.
MCAD - MCSD MCTS Sharepoint 2007 MCTS SQL Server 2005 http://blog.raffaeu.com "If my answer is useful remember to mark it as useful".
raffaeu_bermuda  Tuesday, July 21, 2009 7:23 PM
hi frnd,
thank u..... it worked well... have one more doubt... if i exit from sub menus(child forms) the focus must be on the main form
( mdi parent)... how can i do it.. presently when i exit the project, the control moves to the coding but i want the control in the main form(mdi)
xplorsoftware  Wednesday, July 22, 2009 1:19 PM

You can use google to search for other answers

Custom Search

More Threads

• ToolBox Tab
• Custom control with two child controls: one of them isn't autoscaling
• Can categories in propertygrid comes as expanded...?
• Custom Contro Icon
• Incorrect Serialization of Collection property in IExtenderProvider
• Serializing a Collection
• An error occurred while parsing EntityName.
• ToolStripContainer bitmaps in Document Explorer window.
• Modified DateTimePicker display
• Painting problem