Dim mblnUntil As Boolean Private Sub Command1_Click() mblnUntil = True DoDim i As IntegerFor i = 1 To 1000 DoEvents NextLoop Until Not mblnUntilMsgBox "OK" End SubPrivate Sub Form_Load() Me.KeyPreview = TrueEnd SubPrivate Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii = vbKeyEscape Then mblnUntil = False End If End Sub ***************************************************************************** 欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) http://feiyun0112.cnblogs.com/
Private Sub Command1_Click()
mblnUntil = True
DoDim i As IntegerFor i = 1 To 1000
DoEvents
NextLoop Until Not mblnUntilMsgBox "OK"
End SubPrivate Sub Form_Load()
Me.KeyPreview = TrueEnd SubPrivate Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyEscape Then
mblnUntil = False
End If
End Sub
*****************************************************************************
欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) http://feiyun0112.cnblogs.com/