Hi Curtis,
> What does the variables stand for......
ok, i do it a bit more detailed ;-)
procedure <MaybeEventhandlerForButtonClick>;
var
myCountPanels: Integer; // Number of panels to create
i: Integer; // Just a counter
myX: Integer; // Property Left of panel
myY: Integer; // Property Top of panel
myPanel: TPanel; // Panel to create
myLabel: TLabel; // Label to place on panel;
const
cOffsetX = 20; // Number of Pixel for property Left of first panel
cOffsetY = 20; // Number of Pixel for property Top of first panel
cDistanceX = 100; // Distance (x-Axis) between adjacent panels
cDistanceY = 100; // Distance (y-Axis) between adjacent panels
begin
myCountPanels := 7; // e.g. to create 7 panels
for i := 0 to myCountPanels - 1 do begin
// Calculate Left/Top for i-th panel
myX := cOffsetX + ((i mod 4) * cDistanceX);
myY := cOffsetY + ((i div 4) * cDistanceY);
// Create panel, set parent and place it on form
myPanel := TPanel.Create(Self);
myPanel.Parent := Self;
myPanel.SetBounds(myX, myY, 80, 80);
// Create label, set parent and place it on panel
myLabel := TPanel.Create(Self);
myLabel.Parent := myPanel;
myLabel.AutoSize := False;
myLabel.SetBounds(0,0,80,30);
end;
end;
hope this is a bit clearer and that there are not too many errors in
it. Cause did not check it with delphi.
--
Cheers,
J�rn
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/