System.Windows.Forms.NativeWindow.DestroyHandle Method

Destroys the window and its handle.

Syntax

public virtual void DestroyHandle ()

Remarks

This method destroys the window associated with the NativeWindow.Handle, sets the NativeWindow.Handle property to 0, and calls the NativeWindow.OnHandleChange method to reflect the change. Typically, you only call NativeWindow.DestroyHandle when you are done with the native window.

Note:

The System.Windows.Forms.NativeWindow class automatically will destroy the associated window and release its resources in response to a WM_DESTROY message.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0