unit
Unit1;
interface
uses
Winapi
.
Windows, Winapi
.
Messages, System
.
SysUtils, System
.
Variants, System
.
Classes, Vcl
.
Graphics,
Vcl
.
Controls, Vcl
.
Forms, Vcl
.
Dialogs, Vcl
.
StdCtrls;
type
TForm1 =
class
(TForm)
Button1: TButton;
gbCheckboxes: TGroupBox;
procedure
Button1Click(Sender: TObject);
private
ACB :
Array
[
1..20
,
1..10
]
Of
TCheckBox;
public
end
;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure
TForm1
.
Button1Click(Sender: TObject);
var
I, J :
Integer
;
begin
For
J :=
1
To
10
Do
For
I :=
1
To
20
Do
Begin
ACB[I,J] := TCheckBox
.
Create(Self);
ACB[I,J].Width := ACB[I,J].Height + Self
.
Canvas
.
TextWidth(
'888'
);
ACB[I,J].Top :=
16
+ (J-
1
)*(ACB[I,J].Height+
8
);
ACB[I,J].Left :=
8
+ (I-
1
)*(ACB[I,J].Width+
8
);
ACB[I,J].Caption := IntToStr((J-
1
)*
20
+ I);
ACB[I,J].Parent := gbCheckboxes;
End
;
end
;
end
.