I want to create a window in my Main Windows Form.
Like: An Example and Other Example (Just Minimized) or WinRAR. Is that possible on Windows Forms?
(Note: If my grammar bad, sorry. I'm not English person.)
Asked
Active
Viewed 2,619 times
-1

Can Özkan
- 27
- 1
- 6
-
MDI would probably be the simplest to use. – xxbbcc Aug 22 '16 at 15:15
1 Answers
1
Edited to make the answer less vague / link only
MDI is what you're looking for. First you will need to set your main form's (parent) IsMDIContainer property to true.
After that, you can add a MainMenu, which will give you the option for opening a child form within the parent form. You will need to add a second form to your project to use as a template for the child forms. You will then have to create an instance of that form.
//Create a new instance of the MDI child template form
Form2 chForm = new Form2();
//Set parent form for the child window
chForm.MdiParent=this;
//Display the child window
chForm.Show();
Use this link for more in depth information on MDI Parent and Child forms: Form Inside a form

Community
- 1
- 1

Robert Altman
- 161
- 11
-
This is a borderline [link-only answer](//meta.stackexchange.com/q/8231). You should expand your answer to include as much information here, and use the link only for reference. – Blue Aug 22 '16 at 15:27
-
I tried this but application is throw error: ArgumentException on `chForm.MdiParent=this;` – Can Özkan Aug 22 '16 at 17:31
-
-
Works fine on my end... Follow these steps: 1) Create new WinForm application 2) Change Form1 IsMdiContainer property to True 3) Add new windows form (form 2) 4) Paste above code in to Form1_Load – Robert Altman Aug 22 '16 at 18:15
-