Vbscript 如何在MsgBox中使用带有按钮和图标值的VBApplicationModel
我正在用VBScript处理一个个人项目,我想使用Vbscript 如何在MsgBox中使用带有按钮和图标值的VBApplicationModel,vbscript,Vbscript,我正在用VBScript处理一个个人项目,我想使用vbApplicationModal常量,单击窗口外会导致它闪烁,就像错误消息一样。问题是,我不知道把它放在MsgBox的什么地方。我有: X=MsgBox("Your details from this computer are being harvested using an altered malicious build of IBM Watson.", 0+48+4096, "IBM Watson") 但是,我不知道将vbapplica
vbApplicationModal
常量,单击窗口外会导致它闪烁,就像错误消息一样。问题是,我不知道把它放在MsgBox的什么地方。我有:
X=MsgBox("Your details from this computer are being harvested using an altered malicious build of IBM Watson.", 0+48+4096, "IBM Watson")
但是,我不知道将
vbapplicationmodel
或替代值(0)放在哪里。正如您所看到的,我已经使用了图标和按钮的值,而不是它们的vb代码(0表示只有“OK”,48表示有一个黄色三角形!,4096表示窗口始终位于其他窗口的顶部),因为它较短。我是否也必须使用该值,还是可以混合使用vb值和代码?您可以查看此
Sample = msgBox("Option codes 0+64." & vbCrLf & vbCrLf & "This is an information situation with OK only",0+64, "Information.")
Select Case Sample
Case 1
wScript.Echo "You acknowledged."
End Select
Sample = msgBox("Option codes 1+48." & vbCrLf & vbCrLf & "This is a warning situation with OK and Cancel",1+48, "WARNING!")
Select Case Sample
Case 1
wScript.Echo "You chose OK."
Case 2
wScript.Echo "You chose Cancel."
End Select
Sample = msgBox("Option codes 2+16." & vbCrLf & vbCrLf & "This is a critical situation with Abort, Retry, and Ignore",2+16, "CRITICAL!")
Select Case Sample
Case 3
wScript.Echo "You chose Abort."
Case 4
wScript.Echo "You chose Retry."
Case 5
wScript.Echo "You chose Ignore."
End Select
Sample = msgBox("Option codes 0+16." & vbCrLf & vbCrLf & "This is a critical error situation with OK only",0+16, "CRITICAL ERROR!")
Select Case Sample
Case 1
wScript.Echo "You acknowledged."
End Select
Sample = msgBox("Option codes 3+32." & vbCrLf & vbCrLf & "This is a question situation with Yes, No, or Cancel",3+32, "Question?")
Select Case Sample
Case 6
wScript.Echo "You said Yes."
Case 7
wScript.Echo "You said No."
Case 2
wScript.Echo "You clicked Cancel."
End Select
Sample = msgBox("Option codes 4+32." & vbCrLf & vbCrLf & "This is a question situation with Yes or No only",4+32, "Question?")
Select Case Sample
Case 6
wScript.Echo "You said Yes."
Case 7
wScript.Echo "You said No."
End Select
Sample = msgBox("Option codes 5+16." & vbCrLf & vbCrLf & "This is a critical error situation with Retry or Cancel",5+16, "CRITICAL ERROR!")
Select Case Sample
Case 4
wScript.Echo "You clicked Retry."
Case 2
wScript.Echo "You clicked Cancel."
End Select
您可以按照上面链接中的说明混合值
例如:
X=MsgBox("Your details from this computer are being harvested using an altered malicious build of IBM Watson.",vbExclamation+vbSystemModal+vbYesNo, "IBM Watson")
X=MsgBox("Your details from this computer are being harvested using an altered malicious build of IBM Watson.",vbCritical+vbSystemModal+vbYesNo, "IBM Watson")
编辑:另一个示例:
你可以看看这个
Sample = msgBox("Option codes 0+64." & vbCrLf & vbCrLf & "This is an information situation with OK only",0+64, "Information.")
Select Case Sample
Case 1
wScript.Echo "You acknowledged."
End Select
Sample = msgBox("Option codes 1+48." & vbCrLf & vbCrLf & "This is a warning situation with OK and Cancel",1+48, "WARNING!")
Select Case Sample
Case 1
wScript.Echo "You chose OK."
Case 2
wScript.Echo "You chose Cancel."
End Select
Sample = msgBox("Option codes 2+16." & vbCrLf & vbCrLf & "This is a critical situation with Abort, Retry, and Ignore",2+16, "CRITICAL!")
Select Case Sample
Case 3
wScript.Echo "You chose Abort."
Case 4
wScript.Echo "You chose Retry."
Case 5
wScript.Echo "You chose Ignore."
End Select
Sample = msgBox("Option codes 0+16." & vbCrLf & vbCrLf & "This is a critical error situation with OK only",0+16, "CRITICAL ERROR!")
Select Case Sample
Case 1
wScript.Echo "You acknowledged."
End Select
Sample = msgBox("Option codes 3+32." & vbCrLf & vbCrLf & "This is a question situation with Yes, No, or Cancel",3+32, "Question?")
Select Case Sample
Case 6
wScript.Echo "You said Yes."
Case 7
wScript.Echo "You said No."
Case 2
wScript.Echo "You clicked Cancel."
End Select
Sample = msgBox("Option codes 4+32." & vbCrLf & vbCrLf & "This is a question situation with Yes or No only",4+32, "Question?")
Select Case Sample
Case 6
wScript.Echo "You said Yes."
Case 7
wScript.Echo "You said No."
End Select
Sample = msgBox("Option codes 5+16." & vbCrLf & vbCrLf & "This is a critical error situation with Retry or Cancel",5+16, "CRITICAL ERROR!")
Select Case Sample
Case 4
wScript.Echo "You clicked Retry."
Case 2
wScript.Echo "You clicked Cancel."
End Select
您可以按照上面链接中的说明混合值
例如:
X=MsgBox("Your details from this computer are being harvested using an altered malicious build of IBM Watson.",vbExclamation+vbSystemModal+vbYesNo, "IBM Watson")
X=MsgBox("Your details from this computer are being harvested using an altered malicious build of IBM Watson.",vbCritical+vbSystemModal+vbYesNo, "IBM Watson")
编辑:另一个示例:
常量
VBApplicationModel
的值为0,表示它将自动应用。明确使用该值是没有意义的。常量vbapplicationmodel
的值为0,表示它自动应用。明确使用该值是没有意义的。