Hands-On Tutorial: User Input/Output
How-to: Use Visual Basic InputBox and MessageBox Functions
1. Create a new Visual Basic project named VisualBasicIntro.
2. Add a new Button control to the default form. Set the Text property of the
button to “Temperature Conversion” and name it, cmdConvert. Use the
GroupBox control with no text value around the Button control.
User Input/Output: Design Window
11
Adding Code Using the Code Window
3. Double-click the Button control to open the Code Window with the
cmdConvert _Click subroutine.
4. Declare the variables TemperatureC and TemperatureF as Integers, and
write conversion logic as shown below.
User Input/Output: Code Window
12
Saving and Running the Application
5. Save and run the application to view the output shown below.
User Input/Output: Application Output
13