Sub draw()
Dim bmp As New Bitmap(100, 100)
Dim g As Graphics = Graphics.FromImage(bmp)
Dim pen As New Pen(Color.Black, 1)
g.DrawLine(pen, 10, 10, 90, 10)
PictureBox1.Image = bmp
PictureBox1.Refresh()
End Sub
Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
Dim bmp As New Bitmap(100, 100)
Dim g As Graphics = Graphics.FromImage(bmp)
Dim pen As New Pen(Color.Black, 1)
g.DrawLine(pen, 10, 10, 90, 10)
PictureBox1.Image = bmp
End Sub
Sub draw()
Dim bmp As New Bitmap(100, 100)
Dim g As Graphics = Graphics.FromImage(bmp)
Dim pen As New Pen(Color.Black, 1)
g.DrawLine(pen, 10, 10, 90, 10)
PictureBox1.Image = bmp
PictureBox1.Refresh()
End Sub