Unit 'Controls' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#lcl]

TControl.BeforeDestruction

Performs notifications before the control is destroyed.

Declaration

Source position: controls.pp line 1631

public procedure TControl.BeforeDestruction; override;

Description

BeforeDestruction is a method which performs notifications when an object instance is about to be freed. It allows tasks to be performed which maintain a persistent object instance and its obervers before it is destroyed.

BeforeDestruction is an overridden method in TControl, and calls the inherited method on entry to ensure that csDestroying is included in the ComponentState property for the control and any of its child components. It extends the inherited method by calling DoCallNotifyHandler for any handler routines using the chtOnBeforeDestruction type.

See also

#rtl.classes.TComponent.BeforeDestruction

#rtl.classes.TComponent.Destroying