Input Output Box
Input Output Box
INPUT BOX
An input box is a specially designed dialog box that allows the programmer to request a value from the user and use that value as necessary.
The Interface
Title bar
Command Button
Message/ prompt
Text box
Command Button
INPUT BOX
It contains: A message/prompt - to indicate the requested value.
A textbox for user to enter data.
2 command buttons (Ok, Cancel) - used to
accept or cancel input data. A Title to show the title of the input box
SYNTAX/CODE
InputBox (prompt, title , default option , x position, y position)
Argument Description
String expression displayed as the message in the dialog box. It is required. String expression displayed in the title bar of the dialog box. String expression displayed in the text box as the default response if no other input is provided. If you omit default option, the text box is displayed empty. Numeric expressions that specify custom positioning of the box on screen.
x position, y position
Command button Name : cmdInput Caption : Input Label name : lblShow Caption : Show Name Here
and write
Message/prompt
textbox of the input box. Stop your program, back to your coding and add the following blue colour code:
InputBox(Enter your full name: , Input Name , UPPER CASE ONLY)
Run your program again and find the changes that
Default value
the following code. Make sure you add the code after the Inputbox function code. lblShow.Caption = nama
Run your program again.
OUTPUT BOX
The function of Output box :
Display information to the user. A useful dialog box function for displaying output is the MsgBox (Message box)
Icon
Button
SYNTAX/CODE
MsgBox(Message) , Button type + icon type ,title
Argument Description
String expression displayed as the message in the Message box. It is required Numeric expression that is the sum of values specifying the number and type of buttons to display and the icon style to use.
title
String expression displayed in the title bar of the dialog box. If you omit title, the application name is placed in the title bar.
the following code. Make sure you write the code below the previous code (lblShow.Caption = nama) MsgBox(Hello )
Run your program
BUTTON
0 1 2 3
4
5
ok ok, Cancel Abort, Retry, Ignore Yes, No, Cancel Yes, No Retry, Cancel
ICON
16 32 48
64
Icon
Button