Custom Child Forms
Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
4 posts
Page 1 of 1
It is easy to declare child forms and display them in an MDI container, but alot of people create new forms and have trouble to add controls and position them because its all coded O.o
Well you can make your own form, create your MDI container, and then display your form as a child form inside of the MDI container.
I know its easy, but I am sure that SOMEONE will find this useful. MDI stands for Multiple Document Interface and is used for displaying multiple windows in one form, for example my game maker uses an MDI container to display all of the forms.
You will need two forms, Form1 is our Parent Form, set the properties to IsMdiContainer value to True, your form will turn into an ugly gray form.
Create another form, it can be any type of form and have anything that you want on it.
On my Parent form I used a button to display the child form, here is the code I used:
I declare my form as CustomChildForm, set the text on top of the form, and most importantly I set the MdiParent to my Parent Form. If you do not set the MdiParent it will display as a normal Form.
Here is a screen shot:
I don't mean to be spamming with my tutorials or anything just trying to help people out, I do have more tutorials I want to share but I am going to wait until tomorrow or something, and that's how to set an image and color for the Mdi Container so its not just an ugly gray background ;)
Source code plus if you liked my tutorial please feel free to +rep me
Well you can make your own form, create your MDI container, and then display your form as a child form inside of the MDI container.
I know its easy, but I am sure that SOMEONE will find this useful. MDI stands for Multiple Document Interface and is used for displaying multiple windows in one form, for example my game maker uses an MDI container to display all of the forms.
You will need two forms, Form1 is our Parent Form, set the properties to IsMdiContainer value to True, your form will turn into an ugly gray form.
Create another form, it can be any type of form and have anything that you want on it.
On my Parent form I used a button to display the child form, here is the code I used:
Code: Select all
ChildFormNumber is an integer I created to show the number on the form "ChildForm 1", "ChildForm 2" etc.Dim ChildFormNumber As Integer = 0
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim CustomChildForm As New ChildForm
ChildFormNumber += 1
CustomChildForm.Text = "ChildForm " & ChildFormNumber
CustomChildForm.MdiParent = Me
CustomChildForm.Show()
End Sub
I declare my form as CustomChildForm, set the text on top of the form, and most importantly I set the MdiParent to my Parent Form. If you do not set the MdiParent it will display as a normal Form.
Here is a screen shot:

I don't mean to be spamming with my tutorials or anything just trying to help people out, I do have more tutorials I want to share but I am going to wait until tomorrow or something, and that's how to set an image and color for the Mdi Container so its not just an ugly gray background ;)
Source code plus if you liked my tutorial please feel free to +rep me

You do not have the required permissions to view the files attached to this post.
My name is Tom | Visit my blog where I post new content every day! Tom's Daily Blog | MineCraft is awesome!
Cant +rep since i did not REP anyobdy b4 i repped you LOL
Practice makes perfect!
VIP since: 6-10-2011
VIP since: 6-10-2011
See this is what I love about Code'N'Stuff all the members are nice and we all create great things
. Rep+

4 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023