0% found this document useful (0 votes)
33 views

Lab Exercise 1

The document describes designing a calendar window that displays the current date and time in Visual Basic. It includes labels for the day, month, year, date number, and a digital clock that updates every second. The window is formatted to look like a calendar page with labels centered and in different fonts and sizes. A timer event updates the displayed values every second by formatting the current date/time.

Uploaded by

wbiñas
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Lab Exercise 1

The document describes designing a calendar window that displays the current date and time in Visual Basic. It includes labels for the day, month, year, date number, and a digital clock that updates every second. The window is formatted to look like a calendar page with labels centered and in different fonts and sizes. A timer event updates the displayed values every second by formatting the current date/time.

Uploaded by

wbiñas
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1-1

Exercise 1 Calendar/Time Display


Design a window that displays the current month, day, and year. Also, display the current time, updating it every second (look into the Timer control). Make the window look something like a calendar page. Play with object properties to make it pretty. My Solution: Form:

lblDay

lblMonth

lblTime lblNumber

timDisplay

lblYear

Properties: Form frmCalendar: Caption = My Calendar BorderStyle = 1 - Fixed Single Timer timDisplay: Interval = 1000 Label lblDay: Caption = Sunday FontName = Times New Roman FontBold = True FontSize = 24

1-2
Label lblTime: Caption = 00:00:00 PM FontName = Times New Roman FontBold = True FontSize = 24 Label lblYear: Alignment = 2 - Center Caption = 1998 FontName = Times New Roman FontBold = True FontSize = 24 Label lblNumber: Alignment = 2 - Center Caption = 31 FontName = Arial FontBold = True FontSize = 72 Label lblMonth: Alignment = 2 - Center Caption = March FontName = Times New Roman FontBold = True FontSize = 24 Code: General Declarations: Option Explicit timDisplay Timer Event: Private Sub timDisplay_Timer() Dim Today As Variant Today = Now lblDay.Caption = Format(Today, "dddd") lblMonth.Caption = Format(Today, "mmmm") lblYear.Caption = Format(Today, "yyyy") lblnumber.Caption = Format(Today, "d") lblTime.Caption = Format(Today, "h:mm:ss ampm") End Sub

You might also like