例如:我要创建TLabel类控件10个,通过数组下标的形式能使用Label控件属性吗?
L:TLabel;
L[i].caption:=xxx;

解决方案 »

  1.   

    L:array [ x .. xx] of TLabel;
    L[i].caption:=xxx;
      

  2.   

    L:array [1 .. 10 ] of TLabel;
    for i:=low(l) to high(l) do
    begin
      l[i]:=TLabel.create(self);
    L[i].caption:=xxx;
    end;
      

  3.   

    想问一下.如果我想把Button控件,动态的创建在TPanel中,应如何
      

  4.   

    var
      btn: TButton;
    ....  btn := TButton.create(self)
      btn.parent := panel1;//这句是关键
      ...