Board index » delphi » MDIChild problem... How to hide?...

MDIChild problem... How to hide?...

    Hi there...

    I'm developing a MDI aplication, but i'm having some problems with
this philosophy: I want the MDIChild's to appear only when i want them to,
and i want to close them when ever i want!... Is it to much to ask?...
    If i define all the chid forms as fsMDIChild, they will all show up on
start and the only way to make them go away is to minimize them, 'cause i
can't hide or close them! But i don't want them to just stay there in
plain sight!
    I tryed another soluttion: all files are fsNormal, i change them to
fsMDIChild whenever i want them to show and i change them back to fsNormal
just before closing them.
    The catch is that the form will close and show up again when i change
the form style, re-triggering the the OnShow event, and then close back
when i call the Close method, causing the screen to flicker.
    To avoid this window 'come and go' i 'move it' far out from the
MDIParent form so that the user can't see it and do all the form style
changing away from the users eye, yet, as the MDIChild form changes to
fsNormal, it get's the focus, making the MDIParent form to go innactive
for some time just before the form closes and the MDIParent get's the
focus again, therefore, i don't actually lose the screen flicker! I just
make it less clearer...

    Can anyone help me on this?... I'm using D2.01... TIA...

                                             A.J.Silva
P.S.: Please reply by email as i may miss the post!
--
------------------------------------------------------------------------
  Antnio Jo?o Silva   _   _     Nunca te dado um desejo sem te ser
Universidade do Minho |_| |_  dado o poder de o realizar - Richard Bach
   j...@softlab.pt    | || _| Sorri ainda que o teu sorriso seja triste,
si12...@ci.uminho.pt   |_|     porque mais triste que um sorriso triste
ajsi...@geocities.com               a tristeza de n?o saber sorrir.
   Home page disponivel no URL: http://www.nca.pt/individual/ajsilva
 Pgina alternativa da IURD no URL: http://www.nca.pt/individual/iurd
------------------------------------------------------------------------

 

Re:MDIChild problem... How to hide?...


Hi

I am not sure that this will solve your problem, but here goes:

A MDI-child is shown when you create it. Therefore you have to create the form
your self (F:=TForm.Create) instead of autocreating them.

A form is not destroyd automaticly when you close it. Ypu can make thi happen
by inserting the line Action:=caFree in then onClose (or onClose query) event.

I hope this helps.

Kim

Quote
In article <34C76A54.FAA8A...@softlab.pt>, j...@softlab.pt wrote:
>    Hi there...

>    I'm developing a MDI aplication, but i'm having some problems with
>this philosophy: I want the MDIChild's to appear only when i want them to,
>and i want to close them when ever i want!... Is it to much to ask?...
>    If i define all the chid forms as fsMDIChild, they will all show up on
>start and the only way to make them go away is to minimize them, 'cause i
>can't hide or close them! But i don't want them to just stay there in
>plain sight!
>    I tryed another soluttion: all files are fsNormal, i change them to
>fsMDIChild whenever i want them to show and i change them back to fsNormal
>just before closing them.
>    The catch is that the form will close and show up again when i change
>the form style, re-triggering the the OnShow event, and then close back
>when i call the Close method, causing the screen to flicker.
>    To avoid this window 'come and go' i 'move it' far out from the
>MDIParent form so that the user can't see it and do all the form style
>changing away from the users eye, yet, as the MDIChild form changes to
>fsNormal, it get's the focus, making the MDIParent form to go innactive
>for some time just before the form closes and the MDIParent get's the
>focus again, therefore, i don't actually lose the screen flicker! I just
>make it less clearer...

>    Can anyone help me on this?... I'm using D2.01... TIA...

>                                             A.J.Silva
>P.S.: Please reply by email as i may miss the post!

Re:MDIChild problem... How to hide?...


Antonio Joao Silva <j...@softlab.pt> wrote:

Quote
>    If i define all the chid forms as fsMDIChild, they will all show up on
>start and the only way to make them go away is to minimize them, 'cause i
>can't hide or close them! But i don't want them to just stay there in
>plain sight!

a) If you go into project options and remove the MDI children from the
autocreate list, they won't show up at startup

b) you can minimize a MDI child by closing it and setting the Action
parameter in the FormClose even to caNone.

c) you can destroy a MDI child window by closing it and setting the
Action parameter in the FormClose even to caFree.

Hope this helps
Marc

======================================================================
[ Marc Scheuner, marc.scheu...@berner.ch  CH-3001 BERNE, Switzerland ]
======================================================================

Re:MDIChild problem... How to hide?...


You have to remove all MDI-Childforms from the list of automatically
created forms (menu: Options-Project-Forms).

To remove (close) the forms you have to implement the OnClose-Event for
each MDI-Child.
Sample:
procedure TMyMDIChild.FormClose(Sender: TObject; var Action: TCloseAction);
begin
     Action := caFree;
end;

Antonio Joao Silva <j...@softlab.pt> schrieb im Beitrag
<34C76A54.FAA8A...@softlab.pt>...

Quote
>     Hi there...

>     I'm developing a MDI aplication, but i'm having some problems with
> this philosophy: I want the MDIChild's to appear only when i want them
to,
> and i want to close them when ever i want!... Is it to much to ask?...
>     If i define all the chid forms as fsMDIChild, they will all show up
on
> start and the only way to make them go away is to minimize them, 'cause i
> can't hide or close them! But i don't want them to just stay there in
> plain sight!
>     I tryed another soluttion: all files are fsNormal, i change them to
> fsMDIChild whenever i want them to show and i change them back to
fsNormal
> just before closing them.
>     The catch is that the form will close and show up again when i change
> the form style, re-triggering the the OnShow event, and then close back
> when i call the Close method, causing the screen to flicker.
>     To avoid this window 'come and go' i 'move it' far out from the
> MDIParent form so that the user can't see it and do all the form style
> changing away from the users eye, yet, as the MDIChild form changes to
> fsNormal, it get's the focus, making the MDIParent form to go innactive
> for some time just before the form closes and the MDIParent get's the
> focus again, therefore, i don't actually lose the screen flicker! I just
> make it less clearer...

>     Can anyone help me on this?... I'm using D2.01... TIA...

>                                              A.J.Silva
> P.S.: Please reply by email as i may miss the post!
> --

Other Threads