Lab1

Topics: Visual Basic, Java, Adrenergic receptor Pages: 5 (439 words) Published: January 11, 2014
DPA5018

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 text in label lblOutput in two lines.
b. Set the text color of label lblOutput to Blue.
c. Set the background color of label lblOutput to Yellow.
d. Clear text boxes txtName and txtTarget.

Figure 3b

TSW

Figure 3c

3/4

DPA5018

Programming for Business Applications

Lab 1

Exercise 4

lstFood

Figure 4a
1. Create the interface as shown in Figure 4a.
2. Add a list box to the form. Set the properties of the list box based on Table 4a. Name
Items

3.
4.
5.
6.

lstFood
Nasi Lemak
Laksa
Chicken Rice
Table 4a

Save and run the program.
Remove all the items from Items property.
Add a button btnClick and place it below lstFood.
Referring to the sample output in Figure 4b and 4c, write the code to display the name of the food when btnClick is clicked.

Figure 4b

TSW

Figure 4c

4/4

Continue Reading

Please join StudyMode to read the full document

You May Also Find These Documents Helpful

  • Lab1 Essay
  • Lab1 Essay
  • LAB1 Research Paper
  • Essay about Lab1 Bio156
  • Organ lab1 Essay
  • Essay about Wireshark lab1
  • SCIN135 Lab1 Essay
  • Essay on CS320 Lab1

Become a StudyMode Member

Sign Up - It's Free