|
-
May 16th, 2008, 12:49 PM
#1
Thread Starter
Junior Member
How to close the application when clicking on the close button in title bar
guys,
how to close the application when the user click on the close button on the title bar?
pls suggest
-
May 16th, 2008, 12:57 PM
#2
Thread Starter
Junior Member
Re: How to close the application when clicking on the close button in title bar
is there any way that i can manually close the application or perform any action
on the close button?
-
May 16th, 2008, 01:03 PM
#3
Re: How to close the application when clicking on the close button in title bar
There are several articles about this in the "Closing your forms/program" section of our Classic VB FAQs (in the FAQ forum, which is shown near the top of our home page), such as: How should I close my form/program/class?
-
May 16th, 2008, 01:07 PM
#4
Thread Starter
Junior Member
Re: How to close the application when clicking on the close button in title bar
but what i need is when the user clicks the close button in the title bar (The 'X' button), i want to close an open db connection? how to do that? any idea?
-
May 16th, 2008, 01:19 PM
#5
Thread Starter
Junior Member
Re: How to close the application when clicking on the close button in title bar
well, i have found myself something interesting:
When the form close ('X') button is clicked, it initiates a form_unload event rite?
shall we close all the forms that are loaded and the open connections that are still open to the database and all the closing operations there? is it safe? any concerns reg tat?
now will this event close all the connections that are made to the db in an multiuser environment?
heh heh guys pls bare with me ! getting these hell a lotta Questions now.
suggest pls
-
May 16th, 2008, 01:21 PM
#6
Re: How to close the application when clicking on the close button in title bar
Those questions are all answered by the article that I linked to.
-
May 16th, 2008, 01:25 PM
#7
Thread Starter
Junior Member
Re: How to close the application when clicking on the close button in title bar
sure thanks buddy. will check it out for sure. thanks for your help and that valuable link.
will c ya soon. back again
-
May 17th, 2008, 12:34 AM
#8
Thread Starter
Junior Member
Re: How to close the application when clicking on the close button in title bar
hi i read the article but the question in my mind is:
my application is expected to run from many client machine each connecting to a Database(MS-access) in file server.
So each user will establish a connection when he/she runs my application.
i wanna make the application like, if the user clicks the close button in title bar, the connection to db made by the particular client should close.
now when i use this query_unload() event will it close all the connections made to the db? or will it close only the current client's connection?
pls reply
-
May 17th, 2008, 09:27 AM
#9
Re: How to close the application when clicking on the close button in title bar
The _QueryUnload event should not be used to unload anything (only to allow the user to confirm if they want to close the form/program, if apt), as explained in the article - you should really be using _Unload instead.
As to what closes (and even if it actually closes), like everything in programming, depends on the code you use.. but based on the level of questions you are asking, I doubt that you have the knowledge to communicate with other instances of your program.
Assuming that is true, the connection will just be the one declared in that current instance of your program, so closing it will only affect the current instance.
-
May 17th, 2008, 11:29 AM
#10
Thread Starter
Junior Member
Re: How to close the application when clicking on the close button in title bar
Thank you man. i tried it on myself and got the result.
sorry for bugging with a lotta questions. Thats's my job !
c ya
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|