08 Laboratory Exercise 1
08 Laboratory Exercise 1
08 Laboratory Exercise 1
Object-Oriented Programming Concepts
Objectives:
Materials:
Basic Principles:
This activity will introduce to the students on how to create class in project development. This will
give the students idea for the next topic to be discussed.
Procedures:
1. Hit Start > All Programs > Microsoft Visual Basic 2008 to start the application. Create a
new project and name it as OOP.
2. On the Form1 window, add six (6) Labels, six (6) TextBoxes and two (2) Buttons.
3. Arrange the controls in the form as below.
4. Set the Name property of the textboxes same as their caption labels. For example,
txtStudentID for “Student ID”.
5. Set also the Name property of button Check Entries to btnCheckEntry and button Exit to
btnExit.
9. Under Public Class Form1 code window, write the following code:
End If
End Sub
I. Challenge Exercises:
1. Modify the exercise above and come up with the following conditions for each Textbox. The
conditions should be created as Class.
o Student ID – Validate for Null (empty) value and numeric value. A prompt must appear
to inform user that this field cannot be empty or contain any value other than number.
o First/Middle/Last Name – Validate for Null (empty) value and 30 maximum length of
characters. A prompt must appear to inform user that these fields cannot be empty and
value entered should not exceed 30 characters.