【请教】无效参数问题
在PictureBox绘图中显示了无效参数的问题,g.DrawLines(mpen, Points) 部分是出错的地方,请问怎样解决?谢谢
![](zzz/editor/img/code.gif)
[color=#0000FF]PublicClass Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim y As Single Dim x As Single Dim g As Graphics = Me.PictureBox1.CreateGraphics Dim mpen As New Pen(Color.Red) Dim array As New List(Of PointF) Dim Points As PointF() 'g.Clear(Color.Black) Randomize() y = 200 * Rnd() array.Add(New PointF(x, y)) Points = array.ToArray g.DrawLines(mpen, Points) x = x + 1 End Sub End Class
[/color]
[ 本帖最后由 timeme100 于 2010-9-15 18:54 编辑 ]