Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim canvas As New Bitmap(PictureBox1.Width, PictureBox1.Height) Dim g As Graphics = Graphics.FromImage(canvas) g.DrawLine(Blackpen, 100,100,200,200) g.Dispose() PictureBox1.Image = Canvas End Sub Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click Dim canvas As New Bitmap(PictureBox1.Width, PictureBox1.Height) Dim g As Graphics = Graphics.FromImage(canvas) g.DrawLine(Blackpen, 200,200,300,300) g.Dispose() PictureBox1.Image = Canvas End Sub