RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomForm.DestroyHandle Method

Destroys the control's window without destroying the control.

Pascal
procedure DestroyHandle; override;
C++
virtual __fastcall DestroyHandle();

Call DestroyHandle to dispose of the window, but leave the control intact. The control can later recreate the window if needed. DestroyHandle is the converse operation to CreateHandle. Applications should call the high-level CreateHandle and DestroyHandle methods, rather than the lower-level methods of CreateWnd and DestroyWnd, whenever possible. 

If the control has TWinControl objects as child controls, DestroyHandle calls each of their DestroyHandle methods before calling DestroyWnd to destroy its own handle. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!