API:Vcl.Forms.TCustomForm.DestroyHandle

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure DestroyHandle; override;

C++

virtual void __fastcall DestroyHandle();

Properties

Type Visibility Source Unit Parent
procedure
function
protected
Vcl.Forms.pas
Vcl.Forms.hpp
Vcl.Forms TCustomForm

Description

Destroys the control's window without destroying the control.

Vcl.Forms.TCustomForm.DestroyHandle inherits from Vcl.Controls.TWinControl.DestroyHandle. All content below this line refers to Vcl.Controls.TWinControl.DestroyHandle.

Destroys the control's window without destroying the control.

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.

See Also