vb.net 画直线问题2
发布网友
发布时间:2023-09-27 03:47
我来回答
共1个回答
热心网友
时间:2024-04-15 23:23
'把“Dim graph As Graphics = Me.CreateGraphics”挪到“Button1_Click”事件内,调试过成功!
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim graph As Graphics = Me.CreateGraphics
Dim pen2 As Pen = New Pen(Color.Green, 3)
graph.DrawLine(pen2, 400, 400, 500, 200)
End Sub
End Class