Board index » delphi » making a form under a form I am closing disappear

making a form under a form I am closing disappear

Hello
I have Delphi 6. I have a full-screen form, that contains components like
check boxes, buttons, radio buttons, etc. When the user clicks the Go
button, another full-screen form opens up to display details of what was
selected, from that second form the user then clicks the final Go button.
The second form, then the first form closes, and the actions take place on
the main form. these forms are both called modally, the second details form
is called modally from within the first form (the one with the components).
This all works great except that the first form (the one with the
components) is momentaril;y visible when the second form closes, causing the
buttons and stuff to be visible for a split second.
The first form was called modally and called the second form modally, so the
first form's 'Go' button's click event is something like:
If secondForm.ShowModal = mrOk then
  Modalresult := mrOk;
If you have a better way I'll change this. Anyway, what I wanted is the
second form to close and the main screen to be visible without showing AT
ALL the first form, even for a second. I was going to solve this by making
all the first form's controls invisible from the second form before
returning a Modalresult of mrOk.

do you see what I mean?
Anyone have a better way? I tried making the whole first form invisible
(i.e. firstform.visible := False) but that didn't work.

thanks,

Gino

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

 

Re:making a form under a form I am closing disappear


Quote
> Anyone have a better way? I tried making the whole first form invisible
> (i.e. firstform.visible := False) but that didn't work.

Gino,
don't know if it is a better way .... but why not move the form so far to
left that is not on the visible part of the desktop ?
Form1.Left := ( 50 + Form1.Width ) * (-1);

Don't forget to move it back next time you need it ;-)

Regards,
Toby

Re:making a form under a form I am closing disappear


Hello
Yes, I may try that.
Thanks,
Gino

Quote
"Tobias Schroedel" <tobias.schroe...@t-online.de> wrote in message

news:abiovj$79c$00$1@news.t-online.com...

Quote
> > Anyone have a better way? I tried making the whole first form invisible
> > (i.e. firstform.visible := False) but that didn't work.

> Gino,
> don't know if it is a better way .... but why not move the form so far to
> left that is not on the visible part of the desktop ?
> Form1.Left := ( 50 + Form1.Width ) * (-1);

> Don't forget to move it back next time you need it ;-)

> Regards,
> Toby

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

Re:making a form under a form I am closing disappear


In article <3cdca045$...@corp.newsgroups.com>, "Gino Costa" <gco...@beld.net>
writes:

Quote
>Anyone have a better way? I tried making the whole first form invisible
>(i.e. firstform.visible := False) but that didn't work.

Where did you put that code - I had three forms - button on Form1 (your "main
form") calls Form2 modally,  Button on Form2 (your "first form") calls form3
modally, close button on Form3 (your "second form") has a ModalResult of
mrAbort.

I coded Form2's button ...

  Form2.Visible := false;
  Form3.ShowModal;
  ModalResult := mrAbort;

.. and got a clean closure of Form3 without a flash from Form2.

Or have I missed something.

Alan Lloyd
alangll...@aol.com

Other Threads