Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
For i = 0 To 100
For j = 0 To 100
For k = 0 To 100
DoEvents
Next
Next
Next
MsgBox "hello"
End Sub
Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
MsgBox "ok"
End Sub '我的意思先出现 ok 后出现 hello
Private Sub Command1_Click()
Timer1.Interval = 1
Timer1.Enabled = True
End Sub
Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Debug.Print "MouseUp"
End Sub
Private Sub Timer1_Timer()
Timer1.Enabled = fasle
For i = 1 To 100
For j = 1 To 100
DoEvents
Next j
Next i
Debug.Print "Click"
End Sub
可以看到运行后,先在debug窗口先输出 Mouseup, 然后才是click