Graphics g = this.CreateGraphics(); //创建一个Graphics对象
Pen myPen = new Pen(Color.Blue,1); //创建一个自定义画笔对象
//创建一个正方形rect int myRect_X = this.ClientRectangle.Right/4; int myRect_Y = this.ClientRectangle.Bottom/4; int myRect_Width; int myRect_Height; if(this.ClientRectangle.Height< this.ClientRectangle.Width) {