Form not closing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Are you show your frmWelcomeScreen from like this: "Application.Run(new
frmWelcomeScreen())" ?

Your application will exit with the maim form close.
 
I have a cf2005 program i'm debugging on PPC2003,
when I close the form, it doesn't close the program even when I added

private void frmWelcomeScreen_Closed(object sender, EventArgs
e)
{
Application.Exit();
}

private void frmWelcomeScreen_Closing(object sender,
CancelEventArgs e)
{
Application.Exit();
}

what's up with that? can anyone help? plz.
 
The (X) in the corner is a Minimize button. Change the form properties and
set ShowMinimize to false and it will become an (ok) button, which will
close the Form.

-Chris
 
First ignore Application.Exit...

Your application will close when the main form closes (the one you pass to
Application.Run). If your main form does not have an OK button in the top
right corner (and instead has an X) then toggle the MinimizeBox property
_or_ explicitly call Close on the form e.g. as a result of a button click.

Of course the above is all true if you don't have other worker threads
running; if you do, you will need to terminate them first.

Cheers
Daniel
 
Thanks alot both of you
now if you can plz help me figure out how to handle this with 3 forms
i'll be very happy :)

I have the start form, who calls another form,
now, what should i do with the old form? hide it ?
and when the second form calls the third, hide it aswell ?
and then when they click "OK" on the third one, will it close the three
of them, or only the third one,
and the first, which i've started in the application.run, will still be
hidden and the program won't be terminated?
Plz help me understand this better
 
My previous reply tells you when your app will close. So, no, when you close
the 3rd form (which is not the main form) then your app will not close. Yes,
if your main form (hidden or not) is not closed, neither will your app.

Whether you want to have multiple forms and hide/show them, or allow the
user to navigate between them, or use ShowDialog so they can't, or set their
caption (.Text) to "" so they don't appear in the list or use many panels on
a single form or implement any other scheme... is up to you and your app's
demands.

Also see multiple previous discussions on form navigation:
http://groups.google.com/group/micr....framework.compactframework&q=form+navigation

Cheers
Daniel
 
Back
Top