我有一个第三方应用程序,它为某些操作调用 vsbscript 文件。我想提供一个带有选项选择的用户提示,可以是下拉列表或复选框等。但是,我只能找到输入框选项。
我不认为 HTA 是我的选择(除非有办法从 .vbs 文件中调用它们?)
我的另一个想法是某种 ActiveX 控件,但我找不到在 WindowsXP/Vista 上默认可用的内置控件。
有人对我如何实现这一目标有任何想法吗?
简单的答案是,你真的不能。Tmdean 的解决方案是我能想到的唯一方法。也就是说,您可以美化输入框,使其看起来不可怕。试一试,我不认为这是一个史诗般的失败:
Dim bullet
Dim response
bullet = Chr(10) & " " & Chr(149) & " "
Do
response = InputBox("Please enter the number that corresponds to your selection:" & Chr(10) & bullet & "1.) Apple" & bullet & "2.) Bannana" & bullet & "3.) Pear" & Chr(10), "Select Thing")
If response = "" Then WScript.Quit 'Detect Cancel
If IsNumeric(response) Then Exit Do 'Detect value response.
MsgBox "You must enter a numeric value.", 48, "Invalid Entry"
Loop
MsgBox "The user chose :" & response, 64, "Yay!"
Run Code Online (Sandbox Code Playgroud)