Hi everyone,
Can someone help me with a procedure to handle the clicked event of the Close button (The [X] button on the top right coner of a VB form. I want to be able to query the users intention for clicking, like: Does he want to save before closing ... instead of just closing the window.
I used a command button to achieve this but I also want to do same for the Close button.
The details will depend on what version of VB you're using.
In VB6 you would use the form's QueryUnload and/or Unload events.
13 11242
Hi everyone,
Can someone help me with a procedure to handle the clicked event of the Close button (The [X] button on the top right coner of a VB form. I want to be able to query the users intention for clicking, like: Does he want to save before closing ... instead of just closing the window.
I used a command button to achieve this but I also want to do same for the Close button.
Please, DO NOT post questions in the Member Introductions Forum. Heck, there is even a thread with a title asking you not to.
I am moving this question to the VB forum.
Regards,
Jeff
Hi everyone,
Can someone help me with a procedure to handle the clicked event of the Close button (The [X] button on the top right coner of a VB form. I want to be able to query the users intention for clicking, like: Does he want to save before closing ... instead of just closing the window.
I used a command button to achieve this but I also want to do same for the Close button.
Hi
Try... -
Private Sub Form_Terminate()
-
MsgBox "Hai"
-
End Sub
-
ALL THE BEST!
respond is it helpful...
The details will depend on what version of VB you're using.
In VB6 you would use the form's QueryUnload and/or Unload events.
The details will depend on what version of VB you're using.
In VB6 you would use the form's QueryUnload and/or Unload events.
But it depends on the form and/or type of application. Let us say for an instance we have 1 form and containing all the list of any record, then when adding/modifying a particular record we're using another form and it is shown as vbmodal. What if the user add new record, how can you unload that form without prompting a message box? : )
Rey Sean
But it depends on the form and type of application. Let us say for an instance we have 1 form and containing all the list of any record, then when adding/modifying a particular record we're using another form and it is shown as vbmodal. What if the user add new record, how can you unload that form without prompting a message box? : )
Seems to me, that's way off-topic for this thread. We're dealing with kind of the oposite - what to do when the user clicks Close.
You probably should start a new discussion for your question, including as much detail as possible about the situation.
Hi Killer42
I was only just gave my opinion and it was relevant to the topic. I'll post that question soon : )
Rey Sean
Hi Killer and Lotus,
Very good discussion!
Here we can use any of the above Form Events.
But as Lotus raised a question, it makes some problem when another form is shown MODAL. Please Lotus post a new thread and we try to get a solution.
But where is Kabyr whether he got the solution from this good discussion.
Thank you both of you!
This is my 100th post.
Thank You ALL!
Hi Killer and Lotus,
Very good discussion!
Here we can use any of the above Form Events.
But as Lotus raised a question, it makes some problem when another form is shown MODAL. Please Lotus post a new thread and we try to get a solution.
But where is Kabyr whether he got the solution from this good discussion.
Thank you both of you!
This is my 100th post.
Thank You ALL!
Hi Mohan
Congrats for your 100th post. haha...
I think Kabyr got the solution from this forum. OK, I'll post the question later, I have some work out here. lol : )
Rey Sean
hi
use following code
Private Sub Form_Unload(Cancel As Integer)
If MsgBox("do you want to close this form", vbYesNo) = vbNo Then
Cancel = 1
End If
End Sub
regards
manpreet singh dhillon hoshiarpur
Hi Mohan
Congrats for your 100th post. haha...
...lol : )
Rey Sean
Thank You Lotus!
This is a very good and quick responsive forum!
Thank You Lotus!
This is a very good and quick responsive forum!
Hello Mohan
I've just posted the question as you requested : )
As you've said, this will gonna be interesting lol (haha)
Rey Sean
Thanks everyone!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Form_Unload did the job.
You made my day.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Andy Kowaluk |
last post by:
I have an intranet site that connects to an access database using ASP
(Javascript).
> Currently, when an user attempts to enter a duplicate value into the
> database it is rejected and the user is...
|
by: John Fereira |
last post by:
So, one of the limitations of multipart-form handling is that when an <input
type="file" ..> tag is used it will bring up a window which allows a user to
select a file for upload but won't allow...
|
by: Eric Newton |
last post by:
VB's more declarative nature of handling events is golden. I'm hoping C#
will acquire this type of deal, in addition to the anonymous delegates.
could do same as vb (actually would be easier to...
|
by: ronenk |
last post by:
I have this code to load an authentication form once my app is loaded.
I want the authentication form to be closed if a user is authenticated
successfully and to give the option to close app on his...
|
by: Jorge Ayala |
last post by:
Well I'm trying to catch and act upon a button event that is placed within
the item template of a repeater control. Yet the code I'm using isn't
working. What I've seen out there to explain how...
|
by: Rob Richardson |
last post by:
Greetings!
I am struggling to understand data binding in VB.Net, and it's slow
going.
I have a list box bound to a dataset that is filled from a SQL Server
table. In addition to the list...
|
by: Tad Marshall |
last post by:
Hi,
I'm having limited luck getting an ApplicationException to work right in my
code. This is VB.NET, VS 2003, Windows XP SP2, .NET Framework 1.1.
I thought it would be convenient to take...
|
by: J055 |
last post by:
Hi
How do I tell the user he has tried to upload a file which is too big...
1. when the httpRuntime.maxRequestLength has been exceeded and
2. when the uploaded file is under then...
|
by: Lysander |
last post by:
Thought I would give something back with a few articles. This article is a bit of code to add error handling. When I have time, I want to write articles on multilingual databases, and Access...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |