绘画之前,要先把Painter的宽高设置成最大,然后绘画,然后设置回适合你页面的大小。
如代码
Dim p As WinForm.Painter = e.Form.Controls("Painter1")p.dock = 0p.width = 10000Dim g As Graphics = p.Graphicsg.DrawLine(Pens.Red,30,0,30,60)g.DrawLine(Pens.Red,0,30,60,30)p.Repaint()