Wednesday, 10 August 2011

InputBox

0 comments
 
In the next examples we want to receive a value
from the user when the program is running.
To do so we will use the InputBox command.

The InputBox command syntax is:

VariableName = InputBox ("Text to Display")

After executing this command, the variable
will get the value that the user has entered.

Example:
Put 1 Command button on your form and
enter the following code to its click event:

Dim Elvis As String
Elvis = InputBox("Please Enter your name")
Print Elvis



Run the program and click the button.

A Message Box is appearing with the text "Please Enter your name"
 Type your name in the text box, and press OK. Your name will be printed on the form.

Leave a Reply