Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Console window

Status
Not open for further replies.

proguru

Programmer
Mar 31, 2001
19
0
0
PY
How can i open a console window in a MDI application?
 
My question is how can i open a console child window in a MDI app?
 
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
Code:
Close();
just like normal, but in the form's close method you will need to add:
Code:
Action = caFree;

Good luck James P. Cottingham
 
Greetinx!

A console application executes consequently, therefore console app can not be executed as well as an usual windows app. You need to edit your console app. code for executing under usual win app.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top