protected override void OnPaint(PaintEventArgs pe)
{
// base.OnPaint(pe);
Pen pen = new Pen(Color.Black, 2);
//
//得到原来绘制区域 Rectangle rect = pe.ClipRectangle;
pe.Graphics.DrawRectangle( pen, rect);
} 出现上边框和左边框 比有边框 和下边框 宽度要大
希望指点
{
// base.OnPaint(pe);
Pen pen = new Pen(Color.Black, 2);
//
//得到原来绘制区域 Rectangle rect = pe.ClipRectangle;
pe.Graphics.DrawRectangle( pen, rect);
} 出现上边框和左边框 比有边框 和下边框 宽度要大
希望指点
但是右上角就不能为 (Width,0),应该是(Width-线粗,0),否则就会有一半在外边,所以会显得左、上要比右下的宽度要大。下边的也一样起始点的位置,要计算上相应的线粗的。