<div dir="ltr"><div>I have created several dynamic controls in my form, and setting the BorderSpacing property produces consistently incorrect results.  Dynamically created controls will exhibit borders between themselves, but not to the parent object.  What am I doing wrong?</div><div><br></div><div>Here is a chunk of the offending code.</div><div><br></div>  for index := 0 to 8 do begin<br>    labSurface [index] := tLabel.Create (Application);<br>    with (labSurface [index]) do begin<br>      parent := tabSurface;<br>      Caption := LocationNames [index];<br>      BorderSpacing.Around := 8;<br>      BorderSpacing.Left := 8;<br>      Anchors := [akTop, akLeft];<br>    end;<br>  end;<br><br>  labSurface [0].AnchorSide [akTop].Control := labSurfaceLocation;<br>  labSurface [0].AnchorSide [akTop].Side := asrBottom;<br>  labSurface [0].AnchorSide [akLeft].Control := Parent;<br>  labSurface [0].AnchorSide [akLeft].Side := asrRight;<br>  for index := 1 to 8 do begin<br>    labSurface [index].AnchorSide [akTop].Control := labSurface [index - 1];<br>    labSurface [index].AnchorSide [akTop].Side := asrBottom;<br>    labSurface [index].AnchorSide [akLeft].Control := Parent;<br>    labSurface [index].AnchorSide [akLeft].Side := asrRight;<br>  end;<br><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">"Cows fly like clouds, but are never quite successful." <br>--Megahal</div></div>