The following code will not work. Iget errors on lines 4 and 5 GraphicsFun is underlined and the errors state that "Declaration expected"
There is no other code in this program. Option expliciit is on.
Public Class Form1
Dim GraphicsFun As System.Drawing.Graphics
Dim PenColor As New System.Drawing.Pen(System.Drawing.Color.Red)
GraphicsFun = Me.CreatGraphics
GraphicsFun.Drawline(penColor,(20 ,30, 100, 80)
End Class
W.
Vb.net drawing a line does not work
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Oct 6, 2013, 11:02 PM EDT
Also CreateGraphics is mis-spelled and there is an extra bracket in your DrawLine method:
Private Sub button1_Click( sender As Object, e As System.EventArgs) Handles button1.Click
Dim GraphicsFun As System.Drawing.Graphics Dim PenColor As New System.Drawing.Pen(System.Drawing.Color.Red) GraphicsFun = Me.CreateGraphics GraphicsFun.Drawline(PenColor, 20 ,30, 100, 80) End Sub