0

I created a Delphi 10.4 VCL testing program. On the form, I created a one-row-multi-column TGridPanel and placed a TSpeedButton on column 0. The properties of column 0 are:

SizeStyle: ssAuto
Value: 50

Some properties of the TSpeedButton are:

Align: alClient
Anchors: all false
Margins: all 20
Width: 105
Height: 71

As you can see, I've added margin 20 for all 4 directions for the button. But I can't see the margin in the result.

enter image description here

How can I add some space between the button and the grid cell? You can download the project source at https://www.mediafire.com/file/x65ankhk17c7xk0/test1.rar/file. Thanks.

user130268
  • 1,341
  • 2
  • 12
  • 20

1 Answers1

2

If you want the VCL to respect your Margins, you need to set AlignWithMargins to True.

You could have realised this yourself if you had read the documentation on Margins:

Note: The Margins you set for the control have effect only when AlignWithMargins is set to true and Align is not set to alNone.

Andreas Rejbrand
  • 105,602
  • 8
  • 282
  • 384