1个回答
展开全部
Const y0& = 1110, x0& = 1100, radius& = 750
Private Function oncircle(X As Single, Y As Single) As Boolean
precision = 55000
If Abs((X - x0) * (X - x0) + (y0 - Y) * (y0 - Y) - radius * radius) < precision Then
oncircle = True
Else
oncircle = False
End If
End Function
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Const LEFT_BUTTON = 1
If oncircle(X, Y) Then
Line1.X1 = x0
Line1.Y1 = y0
If Button = LEFT_BUTTON Then
Line1.X2 = X
Line1.Y2 = Y
Else
Line1.X2 = Line1.X1
Line1.Y2 = y0 - Y
End If
Label1.Caption = ""
Else
Label1.Caption = "鼠标位置不对"
End If
End Sub
来自:求助得到的回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询