15-04-2012, 12:29 AM
السلام عليكم
يمكن استعمال width
عرض بانل او الفورم
واجراء عمليات حسابية
نفس الشيء مع Height
مثال
يمكن استعمال width
عرض بانل او الفورم
واجراء عمليات حسابية
نفس الشيء مع Height
مثال
كود :
var
i, H, L, T, W: integer;
LeftS, WidthS: Integer;
GroupBox: TGroupBox;
begin
H := 105;
L := 8;
T := 8;
W := 185;
LeftS := 8;
WidthS := 0;
for i := 1 to 16 do
begin
if Panel1.Width - WidthS > LeftS + W then
begin
GroupBox := TGroupBox.Create(Self);
GroupBox.Parent := Panel1;
GroupBox.Caption := 'GroupBox' + IntToStr(i);
GroupBox.Height := H;
GroupBox.Left := L;
GroupBox.Top := T;
GroupBox.Width := W;
L := L + W + LeftS;
WidthS := WidthS + LeftS + W;
end else
begin
L := 8;
T := T + H;
WidthS := 0;
GroupBox := TGroupBox.Create(Self);
GroupBox.Parent := Panel1;
GroupBox.Caption := 'GroupBox' + IntToStr(i);
GroupBox.Height := H;
GroupBox.Left := L;
GroupBox.Top := T;
GroupBox.Width := W;
L := L + LeftS + W ;
WidthS := WidthS + LeftS + W;
end;
end;
end;
