用代码手动增加6个控件,把这6个控件放入3*2的二维数组,代码怎么写?谢谢

解决方案 »

  1.   

    同问...
    Control[,] arrC = new Control[3,2];
    for(Int32 i =0;i < arr.GetLength(0);i++)
      for(Int32 j=0;j < arr.GetLength(1);j++)
      {
         arrC[i,j] = new Control();
      }
    //Control可写成你想要的空间,eg:TextBox
      

  2.   


                Control[,] arrCtrl=new Control[3,2];
                for(int i=0;i<3;i++)
                {
                    for (int j = 0; j < 2; j++)
                    {
                        TextBox txt = new TextBox();
                        arrCtrl[i,j] = txt;
                    }            }