How can I show a message box with two buttons (For example: "on"
, "off"
)?
相关问题
- How to programmatically convert Access 1997 .mdb t
- VBScript / ADODB Syntax Issue with adArray?
- How to check default host for VBScript is WScript
- vbscript is not working on IE10 browser mode
- Using asp objects in .NET - Max compatibility
相关文章
- Can a VBScript function return a dictionary?
- UTC Time Assignment in VBScript
- Copy and Rename File VBScript
- How do I open a file with VBScript?
- Import WinAPI Function in *.VBS File
- How to reference the mail which triggered the outl
- Classic ASP/VBScript implementation of Crockford
- Convert .csv file into Excel in VBScript
Remember - if you set the buttons to
vbOkOnly
- it will always return 1.So you can't decide if a user clicked on the close or the OK button. You just have to add a
vbOk
option.if the user is supposed to make a decision the variable can be added like this.
The numbers in the middle vary what the message box looks like. Here is the list
0 - ok button only
1 - ok and cancel
2 - abort, retry and ignore
3 - yes no and cancel
4 - yes and no
5 - retry and cancel
TO CHANGE THE SYMBOL (RIGHT NUMBER)
16 - critical message icon
32 - warning icon
48 - warning message
64 - info message
DEFAULT BUTTON
0 = vbDefaultButton1 - First button is default
256 = vbDefaultButton2 - Second button is default
512 = vbDefaultButton3 - Third button is default
768 = vbDefaultButton4 - Fourth button is default
SYSTEM MODAL
4096 = System modal, alert will be on top of all applications
Note: There are some extra numbers. You just have to add them to the numbers already there like
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:
And for God's sake don't do one of these UI monstrosities!
It can be done, I found it elsewhere on the web...this is no way my work ! :)
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):
You probably want to do something like this:
To add an icon:
Other icon options: