We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Add New Child Form to Parent MDI from Child Form

I have a tabbed MDI form that contains one form, say MyChildForm1. When MyChildForm1 is focused/active, I would like to launch another child form, say MyChildForm2 that gets added to the tabbed MDI form. Is there a recommended way of doing this? Thanks in advance! Derek

4 Replies

MJ Mano J Syncfusion Team September 29, 2005 05:35 PM UTC

Hi Derek, I feel like it is not a very usual way of approach. Could you please provide me an exact scenario you need and more details regarding this post? Then it will be convenient for us to work with. Thanks for using Syncfusion products. Regards, Mano


DP Derek Price September 29, 2005 07:20 PM UTC

Consider the VS.NET IDE. It opens with a start page with links to recently opened projects. If you click on one of those links, it opens that project and opens any previously opened files in new tabs. But it keeps the start page open. Does this help? Derek


MJ Mano J Syncfusion Team September 30, 2005 06:21 AM UTC

Hi Derek, Thanks for the details. You should set the child form''s MDIParent to the main form as follows to achieve the behavior. private void buttonAdv1_Click(object sender, System.EventArgs e) { Form3 f1 = new Form3(); // Set the new form''s MDI parent to main form f1.MdiParent = (Form1)this.Parent.Parent; f1.Show(); } Please refer to the sample attached and let me know if this meets your requirements. Thanks for using Syncfusion products. Regards, Mano F35439_9419.zip


DP Derek Price September 30, 2005 01:05 PM UTC

Thanks - that works great! I didn''t realize that there was a parent property until late last night! :) Derek

Loader.
Live Chat Icon For mobile
Up arrow icon