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.
lirenzhao@tom.com - 29 Apr 2006 03:36 GMT
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
[quoted text clipped - 12 lines]
>
> what's up with that? can anyone help? plz.
<ctacke/> - 29 Apr 2006 12:24 GMT
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
>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
[quoted text clipped - 12 lines]
>
> what's up with that? can anyone help? plz.
Daniel Moth - 29 Apr 2006 12:34 GMT
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
--
http://www.danielmoth.com/Blog/
>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
[quoted text clipped - 12 lines]
>
> what's up with that? can anyone help? plz.
chook.harel@gmail.com - 29 Apr 2006 14:57 GMT
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
Daniel Moth - 29 Apr 2006 22:31 GMT
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/microsoft.public.dotnet.framework.compactframewor
k/search?group=microsoft.public.dotnet.framework.compactframework&q=form+navigat
ion
Cheers
Daniel
--
http://www.danielmoth.com/Blog/
> Thanks alot both of you
> now if you can plz help me figure out how to handle this with 3 forms
[quoted text clipped - 8 lines]
> hidden and the program won't be terminated?
> Plz help me understand this better