code=C#]
Pen xuxian = new Pen(Color.Red, 3);
xuxian.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;panel1.CreateGraphics().DrawLine(xuxian,0,0,100,100);
[/code]
因为还有别的线,所以不能乱来(比如:一起刷新).