本帖最后由 cw19931024 于 2014-07-24 21:18:06 编辑

解决方案 »

  1.   

      int num = 0;
                PictureBox[] pic = new PictureBox[50];
                for (int i = 0; i < pic.Length; i++)
                {
                    int h = num / 10;
                    int v = num % 10;              
                    pic[i] = new PictureBox();
                    pic[i].Name = "PictureBox" + Convert.ToString(i + 1);
                    pic[i].BackColor = Color.Black; 
                    pic[i].Size = new System.Drawing.Size(50, 50);
                    pic[i].BackgroundImage = Image.FromFile("image\\"+i+".png");
                    pic[i].Location = new Point(h * 150 + 50, v * 150 + 50); 
                    groupBox1.Controls.Add(pic[i]);
                    num++;      
                }
      

  2.   

    是picturebox控件数组,方式差不多
      

  3.   

    按钮控件数组  int num = 0;
                Button[]  bt=new Button[50];        
                for (int i = 0; i < bt.Length; i++)
                {
                    int h = num / 10;
                    int v = num % 10;
                    bt[i] = new Button();
                    bt[i].Name = "Button" + Convert.ToString(i + 1);
                    bt[i].BackColor = Color.Black;
                    bt[i].Size = new System.Drawing.Size(50, 50);                
                    bt[i].Location = new Point(h * 150 + 50, v * 150 + 50);
                    groupBox1.Controls.Add(bt[i]);
                    num++;
                }
      

  4.   

    SideBar网上有例子,找找
    http://www.cnblogs.com/whtydn/archive/2009/03/19/1416498.html,