【发布时间】:2016-12-21 16:40:39
【问题描述】:
我目前正在将“noughts and crosss”作为家庭作业。我生成了一个 10x10 的 TButton 对象数组,但我不知道它们是如何被调用的以及如何控制它们:
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;
我的按钮是否也在那个数组中?我必须说我在这里有点困惑。
【问题讨论】:
-
你的代码真的是这样缩进的吗?很难阅读。不禁想到,在这个看似匆忙的粘贴练习中,您可能错过了重要的代码。