MdiClient mdiClient = null; // Get the MdiClient from the parent form. for (int i = 0; i < this.Controls.Count; i++) { // If the form is an MDI container, it will contain an MdiClient control // just as it would any other control. mdiClient = this.Controls[i] as MdiClient; if (mdiClient != null) { // The MdiClient control was found. // MessageBox.Show("name "+mdiClient.ToString()); // mdiClient.BringToFront(); break; } }
Form1 frm = new Form1(); // Child form's object Panel p = new Panel(); // Run time a panel is created p.Controls.Add(frm); // add child form in panel this.Controls.Add(p); // 'this' means MDI so, add panel inside MDI p.BringToFront(); // get panel in front or you can focus a control of child form p.show(); // finally show form in MDI
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)