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

# TCustomSpeedButton.Margin

Space between the glyph bitmap and the aligned edge in the button layout.

## Declaration

Source position: buttons.pp line 427

`public property TCustomSpeedButton.Margin : Integer read FMargin write SetMargin default - 1;`

## Description

Margin is an Integer property with the space reserved between the Glyph image an the edge of the control. It is applied on the edge specified in Layout, and refers to a number of pixels. The value -1 has special meaning; it causes both the glyph and caption to be centered on the button surface.

Changing the value for the property causes the control to recalculate its preferred size, and the control is redrawn (in SetMargin).

Margin is used in the MeasureDraw method when the glyph image and caption text are positioned and sized on the control.

Use Layout to specify the edge on the button control to which the glyph bitmap and caption are aligned.

Use Spacing to set the space reserved between the glyph bitmap and the caption for the control.

In TCustomSpeedButton, any value assigned to BorderSpacing.InnerBorder is ignored.

## See also

TCustomSpeedButton.Glyph |  | The bitmap with the glyph image(s) displayed for button states.
TCustomSpeedButton.Images |  | List of images available for use as state glyphs on the control.
TCustomSpeedButton.ImageIndex |  | Ordinal position for the glyph bitmap displayed when the button is in its up state.
TCustomSpeedButton.Layout |  | Indicates the alignment of the glyph bitmap relative to the caption for the control.
TCustomSpeedButton.Spacing |  | Spacing between the Glyph bitmap and the Caption for the control.
TCustomSpeedButton.MeasureDraw |  | Calculates the Width and Height for the layout used on the speed button and optionally renders the control.
TCustomSpeedButton.SetMargin |  | Sets the value for the Margin property.
TControl.Caption |  | The text displayed for the control.
TControl.BorderSpacing |  | Determines the inner and outer border spacing for this control.
TControlBorderSpacing.InnerBorder |  | Space added to the preferred size for the widget.