Torna al Thread
Public Class Form1
Dim X1 As Single
Dim X2 As Single
Dim Y1 As Single
Dim Y2 As Single
Dim RedPen As New Pen(Color.Red, 3)
Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
If e.Button = Windows.Forms.MouseButtons.Left Then
X1 = e.X
Y1 = e.Y
ElseIf e.Button = Windows.Forms.MouseButtons.Right Then
X2 = e.X
Y2 = e.Y
End If
End Sub
Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
e.Graphics.DrawLine(RedPen, X1, Y1, X2, Y2)
End Sub
End Class