How to dispose of variables in windows close button

Posted by cmrhema on Stack Overflow See other posts from Stack Overflow or by cmrhema
Published on 2010-04-13T01:56:59Z Indexed on 2010/04/13 2:02 UTC
Read the original article Hit count: 362

Filed under:
|
|

Hi,

I have a windows forms application, where I have declared some static variables. On the click of exit button, I have disposed of some datatable which i have declared static.

Many a times the user instead of clicking the exit button, will just exit the windows application by clicking the X button on the left corner top.

What should be done to ensure that even if the user clicks the X button, everything is disposed of properly.

Thanks

Regards

Hema

© Stack Overflow or respective owner

Related posts about c#

Related posts about winforms