Can I load a new form into panel?
17,053
Solution 1
I think that I had the same question.
But I found the answer for it
First you have to configurate the Form:
myForm.FormBorderStyle = FormBorderStyle.None;
And then, manipulates the action:
Form1 myForm = new Form1();
myForm.TopLevel = false;
myForm.AutoScroll = true;
frmMain.Panel2.Controls.Add(myForm);
myForm.Show();
Hope to help you. Hugs :D
Solution 2
You can use MDI Form. Try something like this
//Create a new instance of the MDI child template form
Form2 child= new Form2();
//Set parent form for the child window
child.MdiParent=this;
//Display the child window
child.Show()
you can also refer to this site.
Author by
Stone Cold
Updated on July 24, 2022Comments
-
Stone Cold almost 2 years
I am working on Windows Application.I am having a menustrip in one form and I want to ask that, can I have a panel which will load new form on particular click of menustripitem.
Ex:
File Data ABC Hello XYZ Bye
These is my menu bar.On click of ABC I dont want to go on different form can I do something (whatever I want to)on the same form using panel.
Thanks