Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
If Line1.Visible = False Then
x1 = X
y1 = Y
Line1.x1 = x1
Line1.y1 = y1
Line1.Visible = True
Else
Line1.Visible = False
DoEvents
Line (x1, y1)-(X, Y), vbBlack
End If
Else
Line1.Visible = False
End If
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Line1.Visible = True Then
Line1.X2 = X
Line1.Y2 = Y
End If
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
x1 = X
y1 = Y
Line1.x1 = x1
Line1.y1 = y1
Line1.Visible = True
Else
Line1.Visible = False
End If
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Line1.Visible = True Then
Line1.X2 = X
Line1.Y2 = Y
End If
End Sub