If you want the freedom of rolling your own routines, you could adapt the following. Add a form OnCreate handler to a new Lazarus project and copy this:
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Dialogs, StdCtrls;
const MaxCheckBoxes = 10;
Margin = 10;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
procedure CreateCheckboxes;
procedure GetCheckboxID(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
procedure TForm1.CreateCheckboxes;
var
cb: TCheckBox;
lastTop: integer=Margin;
i: Integer;
begin
for i:= 1 to MaxCheckBoxes do
begin
cb:=TCheckBox.Create(Self);
cb.Left:=Margin;
cb.Top:=lastTop;
Inc(lastTop, cb.Height + Margin div 2);
cb.Caption:=Format('Checkbox #%d',[i]);
cb.Tag:=i;
cb.OnChange:=@GetCheckboxID;
cb.Parent:=Self;
end;
Form1.Height:=lastTop;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
CreateCheckboxes;
end;
procedure TForm1.GetCheckboxID(Sender: TObject);
begin
ShowMessageFmt('You clicked checkbox #%d',[TCheckBox(Sender).Tag]);
end;
end.