查看: 331  |  回复: 0
VB6 调用API延迟N秒后继续 Sleep函数
楼主
发表于 2023年5月4日 14:27

新建From1(窗体),新建Command1(按钮CommandButton),代码:

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Sub Command1_Click()
    Call Sleep(3000) '延迟3秒
    MsgBox "码农库真的好!"
End Sub

点击按钮后3秒才去执行下方MsgBox。

您需要登录后才可以回帖 登录 | 立即注册
【本版规则】请勿发表违反国家法律的内容,否则会被冻结账号和删贴。
用户名: 立即注册
密码:
2020-2024 MaNongKu.com