5
Tôi đang sử dụng TFlowPanel và trong thời gian chạy i am tạo một số biến điều khiển (trong ví dụ này TButton) trên đó. Tôi muốn tạo một lề giữa mỗi điều khiển, nhưng nó vẫn chưa hoạt động.Delphi: TFlowPanel lề giữa mỗi điều khiển
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;
Bất cứ ý tưởng tại sao?
Kính trọng và cảm ơn, Dennis
'LButton.AlignWithMargins: = True; '? – kami
Xấu hổ với tôi! Tất nhiên ... Điều đó làm việc cho tôi. Cảm ơn rất nhiều. –