-1

I have a form that consists of a few tabs, each containing a user control. User controls need to know when the main form is closing so they can do some house keeping before closing.

How can I handle the FormClosing event which is thrown in the main form, in each of the UserControls?

adiaz004
  • 137
  • 1
  • 9

1 Answers1

2

If you need to dispose of unmanaged resources in your user control before closing, just have the user control implement the IDisposable pattern (and properly dispose of them within it...).

Proper use of the IDisposable interface

Community
  • 1
  • 1
Drunken Code Monkey
  • 1,796
  • 1
  • 14
  • 18