Add Form Within A Form

Post your questions regarding programming in C# in here.
7 posts Page 1 of 1
Contributors
User avatar
mikethedj4
VIP - Site Partner
VIP - Site Partner
Posts: 2592
Joined: Thu Mar 25, 2010 4:36 am

Add Form Within A Form
mikethedj4
MTech010, had created a great tutorial where you can add a form within a forum. So my question is how can I add a forum within a form in C#???
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: Add Form Within A Form
mandai
Converting the code to C# is simple:
Code: Select all
Form2 newform = new Form2();
newform.TopLevel = false;
this.Controls.Add(newform);
newform.Show();
User avatar
DreadNought
VIP - Donator
VIP - Donator
Posts: 116
Joined: Fri Jan 08, 2010 12:37 pm

Re: Add Form Within A Form
DreadNought
What? that code is wrong afaik..
Code: Select all
Form2 newform = new Form2();
newform.ShowDialog();
Bound and boom tech,
The Future Of Coding
User avatar
Agust1337
Coding God
Coding God
Posts: 2456
Joined: Fri Feb 19, 2010 8:18 pm

Re: Add Form Within A Form
Agust1337
http://converter.telerik.com/ <- Is a really nice c# to vb, or vb to C# converter, and its really simple you only need to make your main form "IsMdiContainer" to True
and then you just make a button saying new form or something and then double click the button or the control and write this code:
Code: Select all
  mdiChild child = new mdiChild ();
            child .MdiParent = this;
            child .Show();
Top-notch casual Dating
User avatar
DreadNought
VIP - Donator
VIP - Donator
Posts: 116
Joined: Fri Jan 08, 2010 12:37 pm

Re: Add Form Within A Form
DreadNought
Those converters dont work right. thats why what u just posted (code) is wrong.

Do what I said as ive been doing c# for the last 7 months
Bound and boom tech,
The Future Of Coding
User avatar
Smiley
VIP - Donator
VIP - Donator
Posts: 269
Joined: Sat Dec 19, 2009 3:39 pm

Re: Add Form Within A Form
Smiley
I asked this once LOL.
Code: Select all
Dim f As New Form
f.Visible = True
f.TopLevel = False
Me.Controls.Add(f)
cooll;
User avatar
Agust1337
Coding God
Coding God
Posts: 2456
Joined: Fri Feb 19, 2010 8:18 pm

Re: Add Form Within A Form
Agust1337
paralyzer wrote:
Those converters dont work right. thats why what u just posted (code) is wrong.

Do what I said as ive been doing c# for the last 7 months
I did not convert it, I coded that in my C# lol and I was just saying he could use it
Top-notch casual Dating
7 posts Page 1 of 1
Return to “General coding help”