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
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?
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?
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?
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
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. ;)
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
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
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.
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 !:D
c ya