473,799 Members | 3,026 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Catching up closing a form

Hello,

What I want to do is quit simple: if the does clicks on the cross at the
right top of the screen I want to catch this event and check a few things
before closing the window. The only thing is, how can I detect somebody has
clicked on it, and how can I possible prevent the window from closing
without hiding the controlbox?

Does somebody have an idea?

greetz
Jul 17 '05 #1
3 5513
> What I want to do is quit simple: if the does clicks on the cross at the
right top of the screen I want to catch this event and check a few things
before closing the window. The only thing is, how can I detect somebody has clicked on it, and how can I possible prevent the window from closing
without hiding the controlbox?


Check out the Form's QueryUnload event.

Rick - MVP
Jul 17 '05 #2
You did put me on a good road to the answer, its "closing" in vb.net, thx
anyway, by searching in help on queryunload I found it ...

greetz
"Rick Rothstein" <ri************ @NOSPAMcomcast. net> schreef in bericht
news:QJ******** ************@co mcast.com...
What I want to do is quit simple: if the does clicks on the cross at the
right top of the screen I want to catch this event and check a few things before closing the window. The only thing is, how can I detect somebody

has
clicked on it, and how can I possible prevent the window from closing
without hiding the controlbox?


Check out the Form's QueryUnload event.

Rick - MVP

Jul 17 '05 #3
For future reference, almost everybody here is using VB6 or lower. While you
may get a stray answer to VB.NET questions here, you should ask them in
newsgroups devoted exclusively to .NET programming. Look for newsgroups with
the word "dotnet" in their name.

For the news.devx.com news server, try these

vb.dotnet.discu ssion
vb.dotnet.techn ical

For the microsoft news server, try these newsgroups...

microsoft.publi c.dotnet.genera l
microsoft.publi c.dotnet.langua ges.vb

There are some others, but these should get you started.

Rick - MVP


"Wortelvisj e" <nb*****@hotmai l.com> wrote in message
news:10******** *******@seven.k ulnet.kuleuven. ac.be...
You did put me on a good road to the answer, its "closing" in vb.net, thx
anyway, by searching in help on queryunload I found it ...

greetz
"Rick Rothstein" <ri************ @NOSPAMcomcast. net> schreef in bericht
news:QJ******** ************@co mcast.com...
What I want to do is quit simple: if the does clicks on the cross at the right top of the screen I want to catch this event and check a few things before closing the window. The only thing is, how can I detect
somebody has
clicked on it, and how can I possible prevent the window from closing
without hiding the controlbox?


Check out the Form's QueryUnload event.

Rick - MVP


Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2262
by: Ron L | last post by:
I have an MDI application with a number of child windows. In each child window I am catching the Closing event and having the child window decide if it should set cancel to true. The intent here is to ensure that no child window can close while it is in a state where user entered information can be lost. I have just noticed that while the Closing event is caught if I click the X on the child window, it is not caught if I click the X on...
3
17221
by: Elp | last post by:
Hi, I've developped a Window Form C# application which main form contains several activex controls. No problems most of the time but on some machine, the application crashes when the main form is closed with a NullReferenceException caused by the DisposeAxControl which, i guess, is supposed to dispose one of my ActiveX. This is not a big problem as the application is closing anyway but i'd like to suppress this crash message. However,...
2
1338
by: Silby | last post by:
Hi, I've a form.load event that initializes a cardreader, which is crucial to the operating of the program. Now if that throws an exception, the program needs to give a message and close down. I tried using Application.Exit(), but that happily executes the rest of the code (initializing a browser component and adding some images to buttons). Does anyone have any idea on how to make the program *really* shutdown without running anything...
10
4030
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the application. What should happen, is that the main MDI form should close, taking the child forms with it. There is code to loop through the child forms, remove the controls on each of them, and then close the form, but this code should execute only...
5
2609
by: lord.zoltar | last post by:
How can I prevent the big close button in the top of the window from closing the window? I want to have and "are you sure?" confirmation so the user must press "Yes" before the program ends. Right now, I've tried catching the FormClosing and FormClosed events. The message box appears at the right time, but since the form is already closing, it doesn't matter if the user presses "Yes" or "No". how do I cancel the FormClosing?
3
1829
by: Anthony P. | last post by:
Hello Everyone, I am writing a Windows Mobile 5.0 application using VS 2..8 in VB.NET. When someone clicks the "Exit" menu option, which generates a button_click() event, I find it easy to display an "Are you sure?" MessgeBox before the application closes. That way, if they accidentally selected exit, they have a chance to back out. But I also want to catch the _closing() event on the form in case the user clicks the application close X...
0
9546
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10491
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10247
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10031
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7571
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5593
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4146
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 we have to send another system
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.