简体   繁体   中英

C# MDI form container wrap child form

I have a container MDI Form in C# with a 2 children in different sizes.

Is there a way when i initialize the new child to the container - i will progmatically set the size of the container to wrap the child form ?

when you opening new form from Mdi parent set its property size :

Form childForm = new Form();
childForm.MdiParent = this;
childForm.Size = new Size(100, 100);//edit size
childForm.Show();

ok i found my answer thanks to IRSOG deleted answer:

    Form form= new Form();
    form.MdiParent = this;
    this.Size = new Size(form.Width, form.Height);
    form.Show();   

hope it will help someone

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM