Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
DestroyHandle Method

NativeWindow.DestroyHandle Method

Destroys the window and its handle.

[Visual Basic]
Public Overridable Sub DestroyHandle()
public virtual void DestroyHandle();
public: virtual void DestroyHandle();
public function DestroyHandle();


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

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


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

NativeWindow Class | NativeWindow Members | System.Windows.Forms Namespace | NativeWindow | Handle | AssignHandle | CreateHandle | ReleaseHandle | WndProc | OnHandleChange

© 2015 Microsoft