unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, PWLists, ComCtrls, CommCtrl;
type
TForm1 =
class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
fEdits :
array of array of TObject;
public
procedure CreateEdits(aiWidth, aiHeight : Integer);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
CreateEdits(10, 10);
end;
procedure TForm1.CreateEdits(aiWidth, aiHeight: Integer);
var i,
j : Integer;
begin
LockWindowUpdate(
Handle);
// hat nix mit Array zu tun
SetLength(fEdits, aiHeight);
for i := 0
to aiHeight - 1
do
begin
SetLength(fEdits[i], aiWidth);
for j := 0
to aiWidth - 1
do
begin
fEdits[i, j] := TEdit.Create(Self);
with fEdits[i, j]
as TEdit
do
begin
Parent := Self;
SetBounds(34 * j + 16, 25 * i + 16, 30, 21);
Text := Format('
%d, %d', [i, j]);
end;
end;
end;
LockWindowUpdate(0);
end;
end.