VBS中,如何控制InputBox 里面的按钮?

2024-12-11 17:22:37
推荐回答(3个)
回答1:

用逻辑运算 "或"
只要有一个条件不满足,就退出

wind = inputbox("请输入字符串, 点击 ""取消""则退出","输入","snow")
if wind = "" or len(wind) < 15 then wscript.quit
wscript.echo "这里是你的执行代码"

回答2:

if inputbox("","")=false then
msgbox "你点了取消或关闭按钮"
else
msgbox "你点了确定"
end if

回答3:

str = InputBox("","")
If str="" Then
WScript.Quit
ElseIf Len(str)<15 Then
MsgBox "Input error"
Else
'Do someting
End If
'Continue to do something
MsgBox "Finished"