我正在尝试在我的VBA课程中完成一个项目并且卡住了。我为大多数单词搜索创建了程序但是我无法使用timerInterval函数。挑战和代码如下:
async_routine3()
答案 0 :(得分:0)
假设您可以使用API调用 - 我更喜欢这种方法。
您只需将文字控件切换为可见/不可见
即可Option Compare Database
Option Explicit
' Simple delay mechanism using Win32 API
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub cmdShow_Click()
txtOutput.Visible = true
End Sub
Private Sub Form_Load()
txtOutput.Value = "hello world"
Sleep 5000 ' 5000 milliseconds = 5 second delay
txtOutput.Visible = false
End Sub
Private Sub cmdCheck_click()
Dim guess As Integer
guess = InStr(txtOutput.Value, txtInput.Value)
If guess = 0 Then
txtResult.Value = "You're terrible at this game"
Else
txtResult.Value = "Good find!"
End If
End Sub