Camsa LabExer2
Camsa LabExer2
HUMAN-COMPUTER INTERACTION
Laboratory No. 2: Calendar/Time Display Application
Objective:
Create a Visual Basic application that continuously displays the current date and time.
Utilize the Timer control to update the display every second.
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 a Form named frmCalendar.
Add a Timer Control (timDisplay) and set its Interval to 1000 (1 second).
Add five Labels to display:
o Day of the week (lblDay)
o Month name (lblMonth)
o Day of the month (lblNumber)
o Year (lblYear)
o Current time (lblTime)
3. Modify Properties:
Set Form caption to “My Calendar”.
Set font properties for better readability.
4. Write Code for the Timer Event (timDisplay_Timer)
Open the Code Editor and write the following:
5. Run and Debug the Application:
Verify that the date and time update every second.
Check formatting for proper alignment.
6. Enhancements:
Change the background color to match a real calendar.
Display an icon or image.
Allow customization of font size.
Deliverables:
✔ Source Code (.vbp, .frm files). Rename the ZIP file as “Lastname-LabExer1”. Submit in LMS.
✔ Laboratory Sheet with Short Report. Submit the PDF copy in LMS.
Short Report (1–2 pages) including:
o Screenshots of the application in action (Initial Form Layout, Running
application with updated time)
o Challenges faced and solutions
Assessment:
✔ Time updates correctly every second
✔ Correct display of day, month, year, and time
✔ Proper formatting and readability
✔ Code efficiency
Discussion and Conclusion: Write your answer on the space provided.
1. Discuss how the objectives were met after performing the activity?
The objectives of this activity were met by successfully creating a Visual Basic 6.0 application
that displays the current date and time. Using the Timer control set to update every second, I
was able to continuously refresh the time display in real-time. The interface was designed with
separate labels to show the day of the week, month name, day number, year, and current time,
all of which updated correctly. By writing code in the timDisplay_Timer event, I ensured that
the time was consistently accurate. I also improved the application by adjusting the font and
background color to resemble a real calendar, which enhanced the overall readability and
design. This task strengthened my understanding of time-based events and dynamic UI updates
in Visual Basic.
This activity showed how Visual Basic can be used to create real-time applications using the
Timer control. I learned how to extract and display different components of the system date and
time, and how to update the interface automatically. The project helped me improve both my
coding and UI design skills, especially in creating readable and user-friendly displays. Overall,
the calendar/time display application was a great hands-on experience that demonstrated the
power of event-driven programming and time handling in VB6.