Vbs msgbox parameters

Vbs msgbox parameters

Author: G@rry Date: 19.07.2017

VBScript allows the developers to interact with the user effectively.

MsgBox Function (Visual Basic)

It can be a message box to display a message to a user or an input box with which user can enter the values. The MsgBox function displays a message box and waits for the user to click a button and then an action is performed based on the button clicked by the user. Prompt - A Required Parameter. A String that is displayed as a message in the dialog box. The maximum length of prompt is approximately characters. If the message extends to more than a line, then we can separate the lines using a carriage return character Chr 13 or a linefeed character Chr 10 between each line.

VBScript Dialog Boxes

A Numeric expression that specifies the type of buttons to display, the icon style to use, the identity of the default button, and the modality of the message box. If left blank, the default value for buttons is 0. Title - An Optional Parameter.

A String expression displayed in the title bar of the dialog box. If the title is left blank, the application name is placed in the title bar. A String expression that identifies the Help file to use to provide context-sensitive help for the dialog box. A Numeric expression that identifies the Help context number assigned by the Help author to the appropriate Help topic.

If context is provided, helpfile must also be provided. The current application will not work until the user responds to the message box. All applications will not work until the user responds to the message box. The above values are logically divided into four groups: The first group 0 to 5 indicates the buttons to be displayed in the message box.

The second group 16, 32, 48, 64 describes the sytle of the icon to be displayed, the third group 0, , , indicates which button must be the default, and the fourth group 0, determines the modality of the message box.

When the above script is executed, the message box is displayed, and if you press No Button, then the value of a is 7. The InputBox function helps the user to get the values from the user. After entering the values, if the user clicks the OK button or presses ENTER on the keyboard, the InputBox function will return the text in the text box.

If the user clicks on the Cancel button, the function will return an empty string "". Default - An Optional Parameter. A default text in the text box that the user would like to be displayed. XPos - An Optional Parameter.

vbs msgbox parameters

The Position of X axis which represents the prompt distance from left side of the screen horizontally. If left blank, the input box is horizontally centered. YPos - An Optional Parameter. The Position of Y axis which represents the prompt distance from left side of the screen Vertically.

If left blank, the input box is Vertically centered. A String expression that identifies the Help file to use to provide context-sensitive Help for the dialog box. When the above script is executed, the input box is displayed and displays the entered value by the user.

VBScript Tutorial - MsgBox

Home Tutorials Library Coding Ground Tutor Connect Videos Search. VBScript - Dialog Boxes Advertisements. Write for us FAQ's Helping Contact.

Rating 4,3 stars - 374 reviews
inserted by FC2 system