Hi Dear friends
How to create MsgBox with two options in VB script
For example
The Msg Box include two buttons
- the first button name: ON
- the second button name: OFF
THX
Yael
Hi Dear friends
How to create MsgBox with two options in VB script
For example
The Msg Box include two buttons
THX
Yael
Cannot be done. MsgBox buttons can only have specific values.
You'll have to roll your own form for this.
To create a MsgBox with two options (Yes/No):
MsgBox("Some Text", vbYesNo)
The VBScript Messagebox is fairly limited as to the labels you can apply to the buttons, your choices are pretty much limited to:
So you are going to have to build your own form if you want "ON"/"OFF"
Better yet, why not rephrase the prompt in the box so one of the above options works.
For example:
Do you want the light on?
[Yes] [No]
And for God's sake don't do one of these UI monstrosities!
Switch setting? (Click "yes" for ON and "No" for Off)
[Yes] [No]
You probably want to do something like this:
result = MsgBox ("Yes or No?", vbYesNo, "Yes No Example")
Select Case result
Case vbYes
MsgBox("You chose Yes")
Case vbNo
MsgBox("You chose No")
End Select