B
Bulba008
How to put pixel or draw line in VB.NET?
Please short example.
B.
Please short example.
B.
* "Jan Tielens said:Following code will draw a line on a form, by hooking up to the paint event:
Private Sub Form1_Paint(ByVal sender As Object, _
ByVal e As System.Windows.Forms.PaintEventArgs) _
Handles MyBase.Paint
Dim g As Graphics = e.Graphics()
Dim pen As New Pen(Color.Black)
pen.Width = 3
g.DrawLine(pen, 1, 10, Me.Width, 10)
\\\
p.Dispose()
///
End Sub
* "Jay B. Harlow said:Did you mean:
pen.Dispose()
As there are no p variables in Jan's example.
You don't want to dispose the Graphics variables as this is the Paint event.