[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Controls' (#lcl)

# TWinControl.AdjustClientRect

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

## Declaration

Source position: controls.pp line 2155

`protected procedure TWinControl.AdjustClientRect(`
`var ARect: TRect`
`); virtual;`

## Arguments

`ARect` |  | The client rectangle examined and updated in the method.

## 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.

## Version info

Behavior modified in LCL version 3.4 to use the adjusted client rectangle when controls are aligned.

## See also

TWinControl.GetAdjustedLogicalClientRect |  | Returns the adjusted logical ClientRect, using the cached value when available.