T
thomasp
I found the following code on MSDN to draw a line in VB2005.
Public Sub DrawLinePoint(ByVal e As PaintEventArgs)
' Create pen.
Dim blackPen As New Pen(Color.Black, 3)
' Create points that define line.
Dim point1 As New Point(100, 100)
Dim point2 As New Point(500, 100)
' Draw line to screen.
e.Graphics.DrawLine(blackPen, point1, point2)
End Sub
This seems to be just what I need, but I can't figure out how to call the
sub. I want my code to determine the two points then have the sub draw the
line.
Call DrawLinePoint() don't work and I don't know what value to pass it. I
hope I am just missing something simple here.
Thanks,
Thomas
Public Sub DrawLinePoint(ByVal e As PaintEventArgs)
' Create pen.
Dim blackPen As New Pen(Color.Black, 3)
' Create points that define line.
Dim point1 As New Point(100, 100)
Dim point2 As New Point(500, 100)
' Draw line to screen.
e.Graphics.DrawLine(blackPen, point1, point2)
End Sub
This seems to be just what I need, but I can't figure out how to call the
sub. I want my code to determine the two points then have the sub draw the
line.
Call DrawLinePoint() don't work and I don't know what value to pass it. I
hope I am just missing something simple here.
Thanks,
Thomas