On your first (main) form, make certain its
FormStyle property is set to
fsMDIForm. This tells the form that it's the MDI parent.
On your second (child) form, make sure its
FormStyle property is set to
fsMDIChild. You will have to include this form's header file to the main form.
Another thing is if you do not want the child form to display when you start the main form, you will need to make certain that the child form is
not in the Auto-Create forms list. This can be found in the project's options. (In BCB3, this is in Shift-Ctrl-F11.)
In this case, you will need some way to open the child form. One easy way is just to create a button. Then in the button's click method, you will need to use the something like the following code:
Code:
Appilcation->CreateForm (__classid(TChildForm), &ChildForm); // create child's form
ChildForm->Show(); // show child's form
Closing the child's form is also more involved. Suppose you have a close button on the child form. In the button's click method you would put
just like normal,
but in the form's close method you will need to add:
Good luck James P. Cottingham