-
child form controls
How to do the below work in C++ ?
main form is: Form1.
child forms are: home and createConf.
Form1 is the Parent MDI.(Main Form/Window)
I am viewing home.
there is a button in home and it is: crtConfBtn
When I click on that crtConfBtn, application should open the child form, createConf, in the Form1. At the same time, the child form, home should be hide or close.
That is clicking crtConfBtn should replace createConf with home.
In other words, home should be override by the createConf.
Please anyone know how to do that?
Edit: I am using Visual C++ for this project and used windows forms to create forms.
-
Re: child form controls
Do you use Visual C++/MFC? Or some of the .net technologie like Windows Form, managed C++/CLI?
-
Re: child form controls
Sorry for the mistake, I am using visual c++ 2010. and i create this application using windows forms.
-
Re: child form controls
I don't really understand your description of your scenario, but as a general design guideline, have the MDI parent form do all the management of the child forms. If you want a child form to trigger an action that affects other child forms, do that by calling a method you wrote in your MDI parent form class, that then carries out the desired actions. You gain access to the MDI parent from the MDI child forms via their MdiParent property. As you're going to call custom methods of your class that are not part of the standard .NET Form class, you'll need to cast the value of the property to the type of your MDI parent class in order to do so (use safe_cast).
It's not imposible to have your MDI child forms interact directly with each other, but that's likely to lead to a bad program design which may quickly become really hard to understand and maintain.