|
-
Jan 11th, 2008, 06:55 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Adding ChildForms
Hello All,
I'm running VB.Net 2005
How does one add a ChildForm to a parent form. The documentation I have states:-
'Create a new form and set it's IsMDIContainer property to True.'
Done that!
'Next, create a child form class to be added to the form. To do this, right-click the project in the Solution Explorer, select Add Windows Form and name the file.'
Done that, I think!
Now here's where I get lost. It then goes on to say, 'to add the child form to the parent, you must create a new child form object, set it's MDIParent to the parent form'
HOW?
Best Rgds,
Tarablue
Last edited by Tarablue; Jan 11th, 2008 at 07:21 PM.
-
Jan 11th, 2008, 07:33 PM
#2
Re: Adding ChildForms
Code:
Dim ChildForm As New Form2
ChildForm.MdiParent = Me
ChildForm.Show()
-
Jan 11th, 2008, 09:26 PM
#3
Thread Starter
Hyperactive Member
Re: Adding ChildForms
Hello bmahler,
I place this code thus:-
Code:
Public Class Form1
Dim ChildForm As New Form2
ChildForm.MdiParent = me
ChildForm.Show()
End Class
right? but that doesn't work. Line one goes in OK but lines 2 & 3 give an error 'Declaration Expected'. Also, ChildForm in both lines is underlined with a blue squiggle.
There must be something that I'm not doing right.
Rgds,
Tarablue
-
Jan 11th, 2008, 09:30 PM
#4
Re: Adding ChildForms
That code has to go inside a method. If you want it done when the form gets loaded then you put it inside the form's Load event handler.
-
Jan 12th, 2008, 12:01 AM
#5
Thread Starter
Hyperactive Member
Re: Adding ChildForms
Hello jmcihinney & bmahler,
Got It!!
Thanks a lot guys.
Rgds,
Tarablue
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|