求教,我想用创建一个stringGrid 的控件数组,怎样定义和创建呀?请大侠帮帮忙。

解决方案 »

  1.   

    参考以下的程序(动态建立的是Tedit控件):
    public
        { Public declarations }
        tl : TList;procedure TForm1.formcreate(Sender: TObject);
    begin
      tl := TList.Create ;
      edit1 := TEdit.Create(nil);
      tl.Add(fledt1);
    end;procedure TForm1.FormDestroy(Sender: TObject);
    begin
      tl.Free;
    end;以后想用就采用一下方法调用
    TEdit(tl[1]).Text := '111';
      

  2.   

    s:array[1..10] of tstringGrid;begin
    for i:= 1 to 10 do
    s[i]:=tstringGrid.create(nil);