I tried this example from the help doc, but it won't work. I'm sure it's a simple mistake. I created a form called form1 with a command control called button1. When I click the button I try to invoke the drawline method where it fails.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Call DrawLineFloat(e)
End Sub
Public Sub DrawLineFloat(ByVal e As PaintEventArgs)
' Create pen.
Dim blackPen As New Pen(Color.Black, 3)
' Create coordinates of points that define line.
Dim x1 As Single = 5
Dim y1 As Single = 10
Dim x2 As Single = 10
Dim y2 As Single = 20
' Draw line to screen.
e.Graphics.DrawLine(blackPen, x1, y1, x2, y2)
End Sub
End Class