PC Review


Reply
Thread Tools Rate Thread

Capture Close Button Event

 
 
John
Guest
Posts: n/a
 
      28th Oct 2005
Hello all:

Is it possible to capture the close event of the 'X' button?

Thanks,

John
 
Reply With Quote
 
 
 
 
Tim Wilson
Guest
Posts: n/a
 
      29th Oct 2005
You can use the Closed, or Closing, event of the Form. If you're using the
..NET 2.0 framework then it's recommended that you use the FormClosed, or
FormClosing, event.

--
Tim Wilson
..NET Compact Framework MVP

"John" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hello all:
>
> Is it possible to capture the close event of the 'X' button?
>
> Thanks,
>
> John



 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      29th Oct 2005
"John" <(E-Mail Removed)> schrieb:
> Is it possible to capture the close event of the 'X' button?


You can intercept closing a form by adding a handler to its 'Closing' event.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

 
Reply With Quote
 
John
Guest
Posts: n/a
 
      29th Oct 2005
Herfried K. Wagner [MVP] wrote:
> "John" <(E-Mail Removed)> schrieb:
>> Is it possible to capture the close event of the 'X' button?

>
> You can intercept closing a form by adding a handler to its 'Closing'
> event.
>

Sometimes is the simplest things that drive you nuts. I had used the
Closing event for some other code that would have prevented its use to
exit the application. However, I neglected the Closed event and it
seems to work just fine. Thank you so much for your direction.

John
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I make prevent the Validate event from going off when the user hits the Close button (the X button) or selects "Close" from the system menu? 0to60 Microsoft Dot NET Framework Forms 5 10th Sep 2008 10:46 AM
Capture close excel event in .xla Tournifreak Microsoft Excel Programming 5 15th Jul 2008 11:44 AM
Capture the before close event Yahya Saad Microsoft Outlook Program Addins 2 8th Nov 2004 08:15 AM
how can i capture the exit/close event when someone clicks the "x" button Mullin Yu Microsoft C# .NET 3 1st Dec 2003 01:50 AM
Re: How to Capture MS Access close event ? Douglas J. Steele Microsoft Access Security 2 29th Aug 2003 07:48 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:54 PM.