标题:【请教】无效参数问题
只看楼主
timeme100
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2010-9-15
 问题点数:0 回复次数:0 
【请教】无效参数问题
在PictureBox绘图中显示了无效参数的问题,g.DrawLines(mpen, Points) 部分是出错的地方,请问怎样解决?
谢谢
程序代码:
[color=#0000FF]Public Class 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 编辑 ]
搜索更多相关主题的帖子: 参数 
2010-09-15 18:51



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-320507-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.556667 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved