private void Form1_Load(object sender, EventArgs e)
        {
            
               //创建数组。数量为imagelist列表的总数
            PictureBox[] stephy = new PictureBox[imageList1.Images.Count + 1];
               //创建随机数
            ArrayList al = new ArrayList();
            while (al.Count <= 4)
            {
                Random rnd = new Random();
               int x= rnd.Next(5);
               if (!al.Contains(x))
               {
                   al.Add(x);
               }
            }
             //随机分配图片
            for(int i=0;i<=4;i++)
            {
                stephy[i] = new PictureBox();
                System.Drawing.Image image = imageList1.Images[int.Parse(al[i].ToString())];
            stephy[i].Image =image;
            int H1 = 0;
            int W1 = 0;            switch (i)
            {
                case 0:
                    H1 = 0;
                    W1 = 0 * image.Size.Width;
                    break;
                case 1:
                    H1 = 0;
                    W1 = 1 * image.Size.Width; ;
                    break;
                case 2:
                    H1 = 120;
                    W1 = 0 * image.Size.Width;
                    break;
                case 3:
                    H1 = 120;
                    W1 = 1 * image.Size.Width;
                    break;                case 4:
                    H1 = 240;
                    W1 = 0 * image.Size.Width;
                    break;
              
            }
            stephy[i].Location = new System.Drawing.Point(W1, H1);
            stephy[i].Size = new System.Drawing.Size(184, 120);
            stephy[i].Tag = i;
            
            this.panel1.Controls.Add(stephy[i]);            
            }
            PictureBox mlgb=new PictureBox();
            mlgb.Image=null;
            mlgb.Tag = 999;
            this.panel1.Controls.Add(mlgb);
            stephy[0].Click += new EventHandler(stephy_Click);
            stephy[1].Click += new EventHandler(stephy1_Click);
            stephy[4].Click += new EventHandler(stephy4_Click);
               }
这是个拼图游戏。现在可以对单个事件控制了。但是怎么找到stephy1.stephy2 这些控件。我要实现。单击stephy1 判断旁边2个 stephy2 stephy3 是否为空。为空的把自己的图像复制给它。然后清空自己。
就像这样
   private void pictureBox1_Click(object sender, EventArgs e)
        {
            
            if (pictureBox2.Image ==null)
            {
                pictureBox2.Image = pictureBox2.Image;
               
                pictureBox1.Image = null;
                
            }
        }   各位高手帮帮忙。先谢了