jjclarkson
jjclarkson

Reputation: 5954

VBScript set focus on "No" button on UI window

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 specials?",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

Upvotes: 0

Views: 1259

Answers (1)

0x5f3759df
0x5f3759df

Reputation: 2359

Replace vbYesNo with vbYesNo OR vbDefaultButton2.

Upvotes: 1

Related Questions