I am currently making "noughts and crosses" as homework. I generated a 10x10 array of TButton
objects, but I don't know how they are called and how to control them:
Form1: TForm1;
pole: array[1 .. 10, 1 .. 10] of TButton;
h:TButton;
for i:=1 to 10 do
for j:=1 to 10 do
begin
h:=TButton.Create(Self);
h.Parent:=Self;
h.Width:=50;
h.Height:=50;
h.Left:=((i+1)*50)-100;
h.top:=((j+1)*50)-100;
h.OnClick := hClick;
end;
Are my buttons even in that array? I must say I am confused a bit here.
At the end of for-loop add
Because every iteration you just overwrite variable 'h' and nothing gets added into array.