请问如何编写一个文字程序,在文本框中统计在该窗口上鼠标的单击次数。谢谢

2024-12-22 21:26:36
推荐回答(2个)
回答1:

Private Sub Form_Mouseup(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then ’左键为1,右键为2,中键为4,想记录哪个键就改为哪个
Text1.Text = Val(Text1.Text) + 1
End If
End Sub

回答2:

对于From的代码Private Sub Form_Load()
Text1 = 0
End SubText的代码Private Sub Form_Click()
Static num As Integer
num = num + 1
Text1 = num
End Sub