开发者

VBScript set focus on "No" button on UI window

开发者 https://www.devze.com 2023-03-19 15:02 出处:网络
I\'m writing a VBScript script for use with VanDyke\'s CRT.Is there a way to set the focus on the \"No\" button on a MsgBox automatically, instead of the default \"Yes\"?

I'm writing a VBScript script for use with VanDyke's CRT. Is there a way to set the focus on the "No" button on a MsgBox automatically, instead of the default "Yes"?

val = MsgBox("Do you want to remove s开发者_JAVA百科pecials?",VBYesNo, "Purchasing Automation")
'6 == yes, 7 == no
If (val = 6) Then
    'we received a yes
    MsgBox("got a yes")
Else
    'no is inferred
    MsgBox("got a no")
End If


Replace vbYesNo with vbYesNo OR vbDefaultButton2.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号