简体   繁体   中英

Prevent child of child going out from MDI Parent Form

How to prevent child.child.Windows going out from MDI Parent Form.

Please see following image.

在此处输入图片说明

Add Product Window is a child of MDI Parent Form. Add Category Window is child of Add Product Window. Add Product Window is not going out from MDI Parent Form as I use following code.

Add_Product obj_AddNewProduct = new Add_Product();
obj_AddNewProduct.MdiParent = this;
obj_AddNewProduct.Show();

But how can I make obj_AddCategory child of MDI Parent Form?

Add_Category obj_AddCategory = new Add_Category();
// obj_AddCategory.MdiParent = this; ???
obj_AddCategory.Show();

Or anyone has better solution?

Simple:

Add_Category obj_AddCategory = new Add_Category();
obj_AddCategory.MdiParent = this.MdiParent;
obj_AddCategory.Show();

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