So, I for the life of me, cannot draw a polygon in VB. I am semi-new to programming, but I have a understanding of lot of the concepts. Here's my code so far (a bit shrunken though, to the parts that affect the drawing):
Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles MyBase.Load
Me.polygonTest()
End Sub
Private Sub polygonTest(ByVal e As System.Windows.Forms.PaintEventArgs)
Dim point1 As New Point(2, 3)
Dim point2 As New Point(100, 300)
Dim point3 As New Point(70, 55)
Dim pts() As Point = {New Point(point1), New Point(point2), New Point(point3)}
e.Graphics.DrawPolygon(Pens.Black, pts)
End Sub
When running this, it says I need to pass something to e. The only thing I've found to actually pass to it for some reason is a Dim'd variable that doesn't have a data type.
Any tips or solutions?
Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles MyBase.Load
Me.polygonTest()
End Sub
Private Sub polygonTest(ByVal e As System.Windows.Forms.PaintEventArgs)
Dim point1 As New Point(2, 3)
Dim point2 As New Point(100, 300)
Dim point3 As New Point(70, 55)
Dim pts() As Point = {New Point(point1), New Point(point2), New Point(point3)}
e.Graphics.DrawPolygon(Pens.Black, pts)
End Sub
When running this, it says I need to pass something to e. The only thing I've found to actually pass to it for some reason is a Dim'd variable that doesn't have a data type.
Any tips or solutions?