Camsa_LabExer1
Camsa_LabExer1
HUMAN-COMPUTER INTERACTION
Laboratory No. 1: Stopwatch Application
Objective:
Develop a Visual Basic application that simulates a stopwatch.
Implement event-driven programming by handling button clicks.
Use system time functions to track elapsed time.
Materials Required:
Visual Basic 6.0
Windows-based computer
Visual Basic Manual for reference
Procedures:
1. Create a New Project:
Open Visual Basic 6.0 and start a new project.
2. Design the User Interface (UI):
Add three Command Buttons: cmdStart, cmdEnd, cmdExit.
Add six Labels to display text and results.
Modify properties:
o cmdStart: Caption = “Start Timing”
o cmdEnd: Caption = “End Timing”
o cmdExit: Caption = “Exit”
o lblStart: Caption = “Start Time”
o lblEnd: Caption = “End Time”
o lblElapsed: Caption = “Elapsed Time”
3. Declare Variables:
Open the Code Editor and declare three form-level variables:
4. Write Code for Buttons:
Start Timing Button (cmdStart_Click)
The objectives of the activity were successfully met through the development of a functional
stopwatch application using Visual Basic 6.0. I was able to design a user-friendly interface with
three buttons and six labels, which clearly displayed the start time, end time, and elapsed time.
By using event-driven programming, I handled button clicks to capture the system time and
calculate the time difference. I also implemented variables to store time values and displayed
them properly on the form. Furthermore, I tested the application to ensure it worked correctly
and debugged any errors encountered during the process. This activity helped me understand
the basics of UI design, time functions, and event handling in VB6.
This activity provided a practical introduction to building interactive applications using Visual
Basic 6.0. It helped me understand how event-driven programming works and how to
manipulate system time for basic functionality. By completing the stopwatch app, I learned the
importance of good UI design and accurate time tracking in software development. The task
also improved my debugging skills and gave me confidence in writing and testing code.
Overall, the activity successfully demonstrated how a simple concept like a stopwatch can be
built using fundamental programming principles.