Einzelnen Beitrag anzeigen

Benutzerbild von Jens Hartmann
Jens Hartmann

Registriert seit: 11. Jan 2009
Ort: Wilnsdorf
1.439 Beiträge
 
Delphi XE2 Professional
 
#6

AW: Frame Align := alClient funktioniert nicht

  Alt 31. Jan 2011, 22:12
Ich habe es hinbekommen,

hier die Lösung...
Delphi-Quellcode:
procedure TFrame1.SetPanelHeight;
var
  i : Integer;
begin
  { Ground 1 }
  pnlGroup1.Height := (pnlGround1.Height div 2);
  pnlGroup2.Height := (pnlGround1.Height div 2);
  pnlGroup1.Align := ClTop;
  pnlGroup1.Left := 1;
  pnlGroup1.Top := 1;
  pnlGroup2.Left := 1;
  pnlGroup2.Top := pnlGroup1.Top + pnlGroup1.Height;
  pnlGroup2.Align := ClClient;

  for i := 1 to 8 do
    begin
      (FindComponent('pnl'+IntToStr(i)) as TPanel).Height := pnlGroup1.Height div 8;
      (FindComponent('pnl'+IntToStr(i)) as TPanel).Left := 1;
      (FindComponent('pnl'+IntToStr(i)) as TPanel).Top := 1 +
        (i * pnlGroup1.Height div 8) - pnlGroup1.Height div 8
    end;
  for i := 9 to 16 do
    begin
      (FindComponent('pnl'+IntToStr(i)) as TPanel).Height := pnlGroup2.Height div 8;
      (FindComponent('pnl'+IntToStr(i)) as TPanel).Left := 1;
      (FindComponent('pnl'+IntToStr(i)) as TPanel).Top := 1 +
        ((i-8) * pnlGroup2.Height div 8) - pnlGroup2.Height div 8
    end;
Gruß Jens
Jens Hartmann
Das Leben selber ist zu kurz, also nutze jeden Tag wie er kommt.
  Mit Zitat antworten Zitat