-
Notifications
You must be signed in to change notification settings - Fork 0
/
HolidayCountdownChristmas.vb
27 lines (27 loc) · 1.24 KB
/
HolidayCountdownChristmas.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Public Class HolidayCountdownChristmas
'MyBase subroutine
Private Sub MyBase_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim CD As Date = Date.Now.ToString("12/25/yyyy")
Dim SD As Date = Date.Now.ToString("M/d/yyyy")
Dim DD As TimeSpan = CD.Subtract(SD)
ChristmasLabel.Text = "Christmas is in " & DD.Days.ToString() & " days (" & CD & ")."
If DD.Days = 1 Then
ChristmasLabel.Text = "Christmas is in 1 day (" & CD & ")."
End If
If DD.Days = 0 Then
ChristmasLabel.Text = "Merry Christmas! Jesus Christ is born!"
End If
HolidayCountdownTimer.Start()
End Sub
'HolidayCountdownTimer subroutine
Private Sub HolidayCountdownTimer_Tick(sender As Object, e As EventArgs) Handles HolidayCountdownTimer.Tick
If TwelveHourButton.Checked = True Then
DateTimeLabel.Text = "Hello! Today is " & Date.Now.ToString("dddd, MMMM d, h:mm tt")
TwentyFourHourButton.Checked = False
End If
If TwentyFourHourButton.Checked = True Then
DateTimeLabel.Text = "Hello! Today is " & Date.Now.ToString("dddd, MMMM d, HH:mm tt")
TwelveHourButton.Checked = False
End If
End Sub
End Class