17.04.2017, 06:38
|
Модератор
|
|
Регистрация: 17.04.2008
Сообщения: 8,015
Версия Delphi: 7, XE3, 10.2
Репутация: 49089
|
|
Ну, у тебя почти получилось:
Код:
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
{ Private declarations }
ACB : Array [1..20,1..10] Of TCheckBox;
public
{ Public declarations }
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.
PS. Мне по кнопке удобнее отлаживать.
|