up~~~遇着同样问题~~~画棋盘我是用DrawLine~~~但是有个问题,就是画了棋盘后,如果切换到其他页面再切换回来,棋盘就没有了····不知道怎么解决····

解决方案 »

  1.   

    我只要能计算 每个格子里的坐标,然后添加一个pic控件上去就行了
      

  2.   

    解决了..
     public void SetCoordinate3(int count)
            {
                string name="";        
                for (int i = 0; i < count; i++)
                {
                    name = "image_" + i.ToString();
                    PictureBox pb = new PictureBox();
                    pb.Name = name;
                    pb.Image = Properties.Resources.he;
                    pb.Tag = "test";
                    this.Controls.Add(pb);
                    pb.Width=23;
                    pb.Height =23;
                    int x = Convert.ToInt32( 80 + 27.9 * (i % 27));
                    int y=Convert.ToInt32(33 + 28 * (i / 27));
                    pb.Location = new System.Drawing.Point(x,y);            }
            }