Timer1.Interval越小坐标越多准越准确...
但是要划出曲线就要另外把代码加到里面了...
也很简单用API几行而已...前题是你画在Form上...
程序代码:
Option Explicit
Dim A() As String, X1 As Integer, Y1 As Integer, nCount As Long
Private Sub Form_Load()
nCount = 0: ReDim A(nCount)
Timer1.Interval = 500
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Timer1.Enabled = True
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Timer1.Enabled = True Then
X1 = X: Y1 = Y
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
ReDim Preserve A(nCount)
A(nCount) = X1 & "," & Y1
List1.AddItem A(nCount), nCount
nCount = nCount + 1
End Sub