Programming for Business Applications
Lab 1
LAB 1
Exercise 1
Figure 1a
1. Create the interface as shown in Figure 1a.
2. Set the properties of the form based on Table 1a. frmQ1 Name
My First VB Program
Text
BackColor White
Table 1a
3. Add a label to the form.
4. Set the properties of the label based on Table 1b: lblMsg I Like Visual Basic!
Font: Verdana
Font Style: Bold
Size: 16
ForeColor Red
Table 1b
Name
Text
Font
5. Add an image to the form using a picture box (Image property). Resize and position the image and the picture box properly.
6. Select File > Save All to save the project.
7. Select Debug > Start Debugging or press F5 to execute the program.
Discussion:
a. Describe control and property.
b. Differentiate between Name and Text properties.
TSW
1/4
DPA5018
Programming for Business Applications
Lab 1
Exercise 2
Modify the program in Exercise 1 based on the following instructions:
1. Add a button to the form. Set the properties of the button based on Table 2a.
Name
Text
btnChange
Change Color
Table 2a
2. When btnChange is clicked, the font color of lblMsg will be changed to Blue.
Double-click on btnChange and write the following code.
3. Write the code to change the background color of the form to Green when btnChange is clicked.
4. Add another button to the form. Set the properties of the button based on Table
2b.
btnMsg
Name
Change Message
Text
Table 2b
5. Write the code to change the display text of lblMsg to “Program completed!” when btnMsg is clicked.
TSW
2/4
DPA5018
Programming for Business Applications
Lab 1
Exercise 3
lblName
txtName
lblTarget
txtTarget btnClick lblOutput
Figure 3a
1. Create the interface and set each control’s properties as shown in Figure 3a.
2. Referring to the sample output in Figure 3b and 3c, write the code to perform the following tasks when button btnClick is clicked:
a. Display the output