Sign in Join
FPDoc Onlineexperiment

TWinControl.RemoveFocus procedure

Member of TWinControlprotectedIn unit Controls

Notifies the parent Form when the control cannot be focused.

Declaration

pascal
procedure RemoveFocus(Removing: Boolean)

Arguments

RemovingTrue if the control is being freed, False when it is not enabled or not visible.

Description

RemoveFocus is a method used to notify the parent form when the control cannot be focused. RemoveFocus is called from methods like Destroy and RemoveControl, where the control will no longer exist on the parent form. It is also called from methods like CMEnabledChanged and CMVisibleChanged, where the parent form should no longer allow the control to be focused.

RemoveFocus calls GetParentForm to get the parent form instance, and calls its DefocusControl method to ensure that the control is removed as the ActiveControl (when assigned).

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.