【发布时间】:2017-08-05 22:33:50
【问题描述】:
我正在使用 TFlowPanel,并且在运行时我正在其上创建可变数量的控件(在此示例中为 TButton)。 我想在每个控件之间创建一个边距,但它还不起作用。
procedure TForm1.FormCreate(Sender: TObject);
var
i: Integer;
LButton: TButton;
begin
for i := 0 to 10 do
begin
LButton := TButton.Create(flwpnl1); // flwpnl1 is the TFlowPanel
LButton.Parent := flwpnl1;
LButton.Height := 20;
LButton.Caption := Format('Status%d', [i]);
LButton.Margins.Left := 20;
LButton.Margins.Top := 20;
LButton.Margins.Right := 20;
LButton.Margins.Bottom := 20;
end;
end;
有什么想法吗?
问候和感谢, 丹尼斯
【问题讨论】:
-
LButton.AlignWithMargins:=True;? -
真丢脸!当然......这对我有用。非常感谢。
标签: delphi controls margin flowpanel