Form inside a form?
How Can I add Form inside a form?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Selva GanapathyPosted Sep 29, 2014, 10:37 AM
You cant Directly add a Form inside another Form But in MDI, Because Form is a Ultimate Parent, But you can set Owner for a Form, That may help you to provide a relation between forms Like
Form1 form1 = new Form1();
Form2 form2 = new Form2();
form2.Owner = form1;
Regards,
Selva Ganapathy K
nathaJegamoorty PillaiPosted Sep 29, 2014, 11:53 AM
VulpesPosted Sep 29, 2014, 11:35 AM
nathaJegamoorty PillaiPosted Sep 29, 2014, 11:17 AM
VulpesPosted Sep 29, 2014, 10:47 AM
using System.Runtime.InteropServices;
// ....
// add this declaration within the parent form:
[DllImport("user32.dll")]
static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
// now use this code to open the child form within the parent:
VulpesPosted Sep 29, 2014, 10:35 AM