You are on page 1of 2

Say Hello to Philippines

In this activity, you will teach the computer to say Hello, Philippines, lets follow
the steps to do program.
1. Define you task.
When I click a button, the computer will display Hello, Philippines in a
message box.

2. Design the user interface.
a. Select the command button in the tool box.
b. Draw the command button on the form by clicking the form and dragging
the mouse.
c. Change the caption of the command button to say hello.

3. Write the instructions.
a. Double-click the command button.
b. Add the following line of code MsgBox Hello, Philippines in the procedure
Private Subcommand 1 ___ Click ().

4. Test the program.
If you have not made any mistake, the following message box will appear
when you click the command button.

If you want to get a decision from the user, the MsgBox function should be used
as follows:
1. Use a variable to store the users decision. For example, the variable is named
as Result.
2. Rewrite the line of code as follows.
Result = MsgBox (Do you really want to quit v b Yes No tyv Question Quit)
3. When the user click a button in the message, the computer assign a value to
the variable Result, therefore, we can check the value of the variable Result so
as to know which common button was pressed by the used.
More About variable *
Variables are used by Visual Basic to hold.
Means than the information stored in your application can be changed during
program execution.

Submitted by: Sydney Troy Reora

Submitted to: Ms. Fatima Nocedo

Subject: Computer

Date: 04/01/14

You might also like