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

# TColorButton.ButtonColorAutoSize

True if the color block for the button can be automatically resized to fill the unused client area.

## Declaration

Source position: dialogs.pp line 381

`published property TColorButton.ButtonColorAutoSize : Boolean read FButtonColorAutoSize write SetButtonColorAutoSize stored IsButtonColorAutoSizeStored;`

## Description

ButtonColorAutoSize is a Boolean property which indicates if the color block for the button can be automatically resized to fill the unused client area in the button control.

When set to True, the client area is examined to determine the dimensions for the color block. Space is reserved using the Caption, BorderWidth, Spacing, and Margin properties defined for the control. The unused area in the client rectangle is drawn using a frame filled with the selected ButtonColor for the control.

When set to False, the value in ButtonColorSize is used as both the height and width for the color block or swatch.

The default value for the property is True as assigned in the constructor for the class instance. Setting a new value for the property causes the control to be redrawn. When ButtonColorAutoSize is True, setting a new value for BorderWidth also causes the control to be redrawn.

ButtonColorAutoSize and ButtonColorSize are used in the GetGlyphSize method.

## See also

TColorButton.Create |  | Constructor for the class instance.
TColorButton.GetGlyphSize |  | Gets the size for the glyph (color block / swatch) on the button control.
TColorButton.ButtonColorSize |  | Size of the color block (or swatch) on the button control.
TColorButton.BorderWidth |  | Width for the borders on the button control.
TCustomSpeedButton.GetTextSize
TCustomSpeedButton.Spacing
TCustomSpeedButton.Layout
TCustomSpeedButton.Margin
TControl.Caption |  | The text displayed for the control.