Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

ASP, VB.net how to properly close a main (form) application

Posted on 2013-12-06
5
407 Views
Last Modified: 2013-12-12
Hi and thanks,

Without going into much detail.

I have a main form and it is being closed by the little X (close) in the upper right corner.

I have noticed that when opening the program it sometimes does not open.

I am guessing that it is because the application is not being closed correctly and that it needs a close button with the recordsets being ended and also a close?  It is mentioned that the MS has a garbage collection that automatically does this?

Thanks
0
Comment
Question by:Amour22015
  • 2
  • 2
5 Comments
 
LVL 35

Accepted Solution

by:
YZlat earned 500 total points
ID: 39701768
Close the form first, and then dispose of it using Dispose(0 method.

If the form is closed by clicking an x, it should be disposed of without an issue. Perhaps there is a different reason why it does not always open
0
 

Author Comment

by:Amour22015
ID: 39701816
So you are saying that closing with the X does close the application properly and you don't have to worry about the recordsets?  I guess this is one of the reasons for VB.net.  I have more experience with VBA...

Thanks
0
 
LVL 35

Expert Comment

by:YZlat
ID: 39701946
I believe so. But you can also go to form's closing event and put the code there to dispose of the form
0
 
LVL 8

Expert Comment

by:johny_bravo1
ID: 39711865
Hi Amour22015,

ASP, VB.net?

What about ASP here?

The situation you describe is pretty confusing. Whenever you close your program's startup form, the entire application should quit automatically, including closing all other open forms.
(You are using MDI form??)

Alternatively ou can use , Application.exit()
0
 

Author Closing Comment

by:Amour22015
ID: 39715014
Thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question