日期:2014-05-18 浏览次数:20853 次
private void Form1_Paint(object sender, PaintEventArgs e) { e.Graphics.DrawEllipse(Pens.Red, new Rectangle(0, 0, 100, 100)); e.Graphics.DrawLine(Pens.Red, new Point(0, 0), new Point(100, 100)); }
------解决方案--------------------
在picture的Paint事件中写一楼的代码。完整的如下:
private void picture1_Paint(object sender, PaintEventArgs e)
{
e.Graphics.DrawEllipse(Pens.Red, new Rectangle(0, 0, 100, 100));
e.Graphics.DrawLine(Pens.Red, new Point(0, 0), new Point(100, 100));
}