-
March 26th, 2014, 06:39 AM
#1
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.
Last edited by jrmkr; March 26th, 2014 at 09:27 AM.
-
March 26th, 2014, 06:44 AM
#2
Re: child form controls
Do you use Visual C++/MFC? Or some of the .net technologie like Windows Form, managed C++/CLI?
Victor Nijegorodov
-
March 26th, 2014, 06:51 AM
#3
Re: child form controls
Sorry for the mistake, I am using visual c++ 2010. and i create this application using windows forms.
-
March 26th, 2014, 05:23 PM
#4
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.
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|