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 11260 numberwhun 3,509
Recognized Expert Moderator Specialist
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: 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: 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...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |