Public x1 As Long
Public y1 As Long
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If x1 = 0 And y1 = 0 Then
    x1 = x
    y1 = y
Else
    Line (x1, y1)-(x, y)
    x1 = x
    y1 = y
End If
End Sub

解决方案 »

  1.   

    Private Sub Form_Load()
        Picture1.MousePointer = vbCrosshair
        Picture1.AutoRedraw = True
    End SubPrivate Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Button = 1 Then Picture1.CurrentX = X: Picture1.CurrentY = Y
    End SubPrivate Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Button = 1 Then Picture1.Line -(X, Y), vbBlack
    End Sub