Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

hide form on creation new form (Part 2)

6 views
Skip to first unread message

Thomas Colvin

unread,
Jul 10, 2008, 12:03:15 AM7/10/08
to
Hi al,
And especially Gambit and bmahn.

Here is wgat I just tried and the results,

Form2.close;
Form3.ShowModal;

and here is what happened. When I pulled form3 to side so I could see behind
it form2 was still there, but when I clicked the "close button" on form 3
then both forms closed.

Each form has it's own close button to shut that form down and ofcourse the
main form has one also but when you close it the whole program shuts down as
it is supposed to do.

But as you move from form to form I don't want them all on, I want the one
leaving to shut down as I go to the new one.

And tried the Form2.hide as suggested and program instantly locked up and
went into debug and after an hour I shut machine down and started over.

Any new ideas on how to shut form 2 down on going to form 3?

Thanks, Thomas


bmahn

unread,
Jul 10, 2008, 3:30:03 AM7/10/08
to
> and here is what happened. When I pulled form3 to side so I could see behind
> it form2 was still there, but when I clicked the "close button" on form 3
> then both forms closed.

When you close the mainform then the application will be terminated.
So keep the mainform hidden or minimized and do not close it.
The first created form is the main form of the application.
You can see this in the project options in the list, it's the first form
in the list.

(If you only do not want to have a button in the taskbar for the main
form do:
Application.ShowMainForm := False;
in your .dpr file but then you have to guarantee for another way to
access to your application, i.e. a tray icon.)

> Each form has it's own close button to shut that form down and ofcourse the
> main form has one also but when you close it the whole program shuts down as
> it is supposed to do.

look above, main form closing terminates application

> But as you move from form to form I don't want them all on, I want the one
> leaving to shut down as I go to the new one.

You can not call a modal form from an already closed form.
Keep this hidden or minimized when you want to show a new modal form.

> And tried the Form2.hide as suggested and program instantly locked up and
> went into debug and after an hour I shut machine down and started over.

Sure, the modal form is waiting for response but is locked by the
'closed' form.

look at borland.public.attachments for a message with subject
"hide form on creation new form (Part 2)".

0 new messages