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

# TCustomBitBtn.Spacing

The space reserved between the bitmap and the caption on the button control.

## Declaration

Source position: buttons.pp line 230

`public property TCustomBitBtn.Spacing : Integer read FSpacing write SetSpacing default 4;`

## Description

Spacing is an Integer property with the number of pixels used to separate the Glyph (or image) displayed on the button and its Caption. The default value for the property is 4 pixels.

The number of pixels in Spacing is always displayed - even when the Caption is an empty string. To suppress drawing of the additional space, set the property to 0.

Changing the value for the property causes the widgetset instance to be updated when its handle has been allocated. AdjustSize is called to auto-size a visible control and its parent. At design-time, the Invalidate method is called to redraw the control.

The property value is used in the InitializeWnd method to set the initial value in the widget class.

Use Layout to specify the edge on the button control to which the glyph bitmap is aligned.

Use Margin to set the space reserved on the aligned edge prior to the glyph bitmap.

Remark: | For the macOS Carbon widgetset, the Spacing property is not supported. Layout and alignment is determined by the native control for the platform.

## See also

TCustomBitBtn.Caption |  | Contains the descriptive text displayed for the Bitmap button control.
TCustomBitBtn.Glyph |  | Bitmap with the Glyph displayed on the control.
TCustomBitBtn.Images |  | Contains the list of images available for use as the glyph on a custom button control.
TCustomBitBtn.ImageIndex |  | Ordinal position for the default bitmap displayed when the button control is up (not pressed).
TCustomBitBtn.Layout |  | Layout or alignment for the glyph bitmap and caption on the control.
TCustomBitBtn.Margin |  | The space prior to the glyph bitmap on the aligned edge of the button layout.