Board index » cppbuilder » hiding an mdi child configuration dialog?

hiding an mdi child configuration dialog?

I am creating an MDI application that allows the user to open numerous
mdi child windows.  I would like to associate a separate configuration
dialog box with each one of these child windows.  My utimate goal is to
put numerous TEdit components which the user can set, that will in turn
constrain the decisions my program makes.  I have created a form for the
configuration dialog with the formstyle property set to fsMDIChild. (I
want the configuration dialog to be constrained within the parent
window).  I create the configuration dialog in the constructor for my
child window.   My problem is, that I don't want this form to be visible
to the user unless he/she selects a menu option "configure".  How do I
hide this form until the user decides to use it?  How do I make it
visible again?  Is there a component that encompasses this type of
behavior?

I saw an earlier post as follows:

--

Is there any way i can hide a MDI Child, without unloading it?  I want
all

Quote
>the controls as they are but i don't want the user to see the form.
Any
>ideas?

How about the win api ShowWindow(handle, SW_HIDE)  ;-)

---

But I have been unable to find documentation in Borland Help on using
this call, or what the complementary "unhide" call would be.  If this is
the ONLY solution, where can I get more info on how to do this?

Thanks

 

Re:hiding an mdi child configuration dialog?


Hi Victor,

Quote
> I create the configuration dialog in the constructor for my
> child window.  My problem is, that I don't want this form to be visible
> to the user unless he/she selects a menu option "configure".  How do I
> hide this form until the user decides to use it?  

You can use the ShowWindow() API function, specifying the SW_HIDE flag...

__fastcall TMDIChild::TMDIChild(TComponent *Owner)
    : TForm(Owner)
{
    Form2 = new TForm2(this);
    ShowWindow(Form2->Handle, SW_HIDE);

Quote
}
> How do I make it visible again?  

Use the same function, specifying the SW_SHOW flag instead...

ShowWindow(Form2->Handle, SW_SHOW);

Quote
> But I have been unable to find documentation in Borland Help on using
> this call, or what the complementary "unhide" call would be.  If this is
> the ONLY solution, where can I get more info on how to do this?

The ShowWindow() function is part of the Windows API.  The best place for info
on API functions is MSDN...

http://search.microsoft.com/us/dev/

simply type in "ShowWindow" in the search field.  Also, Builder does ship with
Windows API documentation.  It may be installed on your system already, but is
definitely available on the CD.

Good luck!

--------------------------------------
Damon Chandler

http://bcbcaq.freeservers.com
Answers to <Commonly Asked Questions>
52064929

Other Threads