Einzelnen Beitrag anzeigen

EarlyBird

Registriert seit: 29. Mär 2007
235 Beiträge
 
#5

Re: TScrollbox mit dynamischem Inhalt sorgt für Chaos

  Alt 26. Apr 2007, 14:01
Versuch es mal damit:
Delphi-Quellcode:
procedure TForm2.Button1Click(Sender: TObject);
var
  panel : TPanel;
  I : Integer;
begin
FlowPanel1.AutoWrap := False;
FlowPanel1.AutoSize := True;
FlowPanel1.Align := alTop;
FlowPanel1.FlowStyle := fsTopBottomLeftRight;


    for I := 0 to 20 do
      begin
        panel := TPanel.Create(self);
        panel.Width := FlowPanel1.Width;
        panel.Height := 26;
        panel.Parent := FlowPanel1;
        panel.Show;
        panel.Caption := 'No.: ' + IntToStr(I) + ' / height= ' + inttostr(panel.Height);
      end;

   FlowPanel1.Controls[1].Height := 50;
   TPanel(FlowPanel1.Controls[1]).Caption := 'No.: 1 / height= ' + IntToStr(FlowPanel1.Controls[1].Height);

   FlowPanel1.Controls[2].Height := 5;
   TPanel(FlowPanel1.Controls[2]).Caption := 'No.: 2 / height= ' + IntToStr(FlowPanel1.Controls[2].Height);

   FlowPanel1.Controls[3].Height := 100;
   TPanel(FlowPanel1.Controls[3]).Caption := 'No.: 3 / height= ' + IntToStr(FlowPanel1.Controls[3].Height);

    Caption := IntToStr(FlowPanel1.Height);
end;
Gruß
EarlyBird
  Mit Zitat antworten Zitat