Sign in Join
FPDoc Onlineexperiment

TWinControl.AdjustClientRect procedure

Member of TWinControlprotectedIn unit Controls

Override this method when the ClientRect for a control differs from the default value.

Declaration

pascal
procedure AdjustClientRect(var ARect: TRect); virtual

Description

In TWinControl, the virtual method has an empty implementation. It can be overridden in descendent classes to perform actions needed for the class type. Such as:

  • Shrink or grow the client rectangle to account for added or removed borders or bezels.
  • Reserve space for companion controls or user interface elements.
  • Set state or configuration flags which affect the client rectangle for the class.

AdjustClientRect can be called often, especially during auto-sizing and anchoring operations. Do not use expensive code here, or cache the resulting client rectangle for subsequent access.

See also

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