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

# TCustomEdit.CalculatePreferredSize

Gets the preferred size for a new instance of the class.

## Declaration

Source position: stdctrls.pp line 799

`protected procedure TCustomEdit.CalculatePreferredSize(`
`var PreferredWidth: Integer;`
`var PreferredHeight: Integer;`
`WithThemeSpace: Boolean`
`); override;`

## Arguments

`PreferredWidth` |  | Preferred width calculated for the control.
`PreferredHeight` |  | Preferred height calculated for the control.
`WithThemeSpace` |  | True when space is reserved for theme element details.

## Description

CalculatePreferredSize is overridden in TCustomEdit, and calls the inherited method on entry. CalculatePreferredSize sets the value in the PreferredWidth parameter to 0 (zero).

## See also

TWinControl.CalculatePreferredSize |  | Override this method to return a different preferred height and/or width for auto-sizing.