在picturebox中画线
大体上意思是这样
--------------
| pictu|rebox |
--------------
e.Graphics.DrawLine(new Pen(Color.Black,5 ), new Point(this.pBx_bjl .Location .X + (this.pBx .Width +66)*(i-1), this.pBx_bjl .Location .Y ), new Point(this.pBx_bjl .Location .X + (this.pBx .Width +66)*(i-1) ,xxxxxxx)); 
在红线位置画线,红色部分的坐标的y轴坐标是多少,为什么画不进去,都画在外面,没有画在picturebox中
注:
picturebox的 size(x,16)也就是picturebox的宽度是16

解决方案 »

  1.   

    线画上去了,但被刷新掉了
    了解些GDI+基础去
      

  2.   

    写在paint事件中可解决问题。
      

  3.   

    code=C#]
    private void pictureBox3_Paint(object sender, PaintEventArgs e)
            {
                e.Graphics.DrawLine(new Pen(Color.Black, 5), new Point((e.ClipRectangle.Width-5) / 2, e.ClipRectangle.Top), new Point((e.ClipRectangle.Width-5) / 2, e.ClipRectangle.Height));  
            }
    [/code]