Sign in Join
FPDoc Onlineexperiment

SaveFocusState function

In unit Forms

Saves the last focus state (focused control) in an application.

Declaration

pascal
function SaveFocusState: TFocusState

Description

SaveFocusState returns the value from the LastFocusedControl variable in the implementation for the unit. The type used for the return value is TFocusState, and is a Pointer to the TWinControl instance in LastFocusedControl.

SaveFocusState is used, along with RestoreFocusState, in form and dialog methods (like SetFocusedControl, ShowModal, and Execute) and when the value in FocusedForm is updated in TScreen.

See also

An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.