Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Compact Framework / June 2004

Tip: Looking for answers? Try searching our database.

Beginner again - Closing VB .net application

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve Howard - 30 Jun 2004 03:30 GMT
From what I see in the help the following should close my app:-

Application.Exit()

but what it appears to do instead is freeze it. Suggestions?

Steve
Tim Wilson - 30 Jun 2004 04:31 GMT
While Application.Exit() should close your application, the definite
recommended way to exit would be to call the Close method on your main form
instead.
http://wiki.opennetcf.org/ow.asp?CompactFrameworkFAQ%2FClosingForms

Signature

Tim Wilson
.Net Compact Framework MVP

> From what I see in the help the following should close my app:-
>
[quoted text clipped - 3 lines]
>
> Steve
Steve Howard - 30 Jun 2004 14:28 GMT
> While Application.Exit() should close your application, the definite
> recommended way to exit would be to call the Close method on your main form
> instead.
> http://wiki.opennetcf.org/ow.asp?CompactFrameworkFAQ%2FClosingForms

Ahhh, thanks. With a little more digging around, I found I could use
Me.Close() to achieve what I want.

Am I right in thinking that once I have built a more complex application I
will need to build something more robust - e.g. close each individual form
component first before issuing a Close.Me() to kill the entire application?

Steve
Tim Wilson - 30 Jun 2004 15:41 GMT
While I don't think that's absolutely necessary, I would say out of good
practice make sure to Close each open form before you Close your main form.

Signature

Tim Wilson
.Net Compact Framework MVP

> > While Application.Exit() should close your application, the definite
> > recommended way to exit would be to call the Close method on your main
[quoted text clipped - 10 lines]
>
> Steve
Steve Howard - 30 Jun 2004 16:39 GMT
> While I don't think that's absolutely necessary, I would say out of good
> practice make sure to Close each open form before you Close your main form.

Whilst looking for something else I found sample code that appeared to

- Keep a count of each form object used
- have something that then would close each in turn on demand, decrementing
a counter too.

Of course I cannot find that code now that I *want* it  :-)

Is the above method strictly necessary, or is it possible to build something
like (pseudocode alert!!!!!)

repeat with Obj = each object in mainForm
   Obj.Close
end

Steve
Tim Wilson - 30 Jun 2004 18:02 GMT
In the help file for Form.Show() it indicates that "when a form is closed,
all resources created within the object are closed and the form is
disposed." Unless you are seeing some type of issue in your application I
would say that what you've pseudocoded wouldn't be that necessary. Just
close forms when you're done with them.

Signature

Tim Wilson
.Net Compact Framework MVP

> > While I don't think that's absolutely necessary, I would say out of good
> > practice make sure to Close each open form before you Close your main
[quoted text clipped - 16 lines]
>
> Steve
Steve Howard - 30 Jun 2004 18:15 GMT
> In the help file for Form.Show() it indicates that "when a form is closed,
> all resources created within the object are closed and the form is
> disposed." Unless you are seeing some type of issue in your application I
> would say that what you've pseudocoded wouldn't be that necessary. Just
> close forms when you're done with them.

OK, thanks Tim.

Steve

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.