Mario The Spoon
Mario The Spoon

Reputation: 4869

Is there an event when the window handle is destroyed

Since the destruction of a window handle disables the invoke mechanism, I do want to unsubscribe to an background-worker that notifies me.

So is there an event that is fired shortly before the window handle of a windows form is closed.

( I have seen this Is there a variant of Control.BeginInvoke which works before/after the handle is destroyed? but I do not like it and if possible want to avoid it... )

TIA

Mario

Upvotes: 2

Views: 1243

Answers (1)

Thomas Levesque
Thomas Levesque

Reputation: 292615

You can use the HandleDestroyed event (or override the OnHandleDestroyed method).

Upvotes: 3

Related Questions