Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub tmrNow_Tick(sender As Object, e As EventArgs) Handles tmrNow.Tick
- curT = DateTime.Now
- txtNow.Text = curT.ToString("hh:mm")
- '1st Class
- If curT.Hour = 7 AndAlso (curT.Minute >= 0 And curT.Minute <= 45) Then
- lblPeriod.Text = "1st Period "
- txtPassed.Text = curT.ToString("mm:ss")
- '2nd Class
- ElseIf (curT.Hour = 7 And curT.Minute > 50) Or (curT.Hour = 8 And curT.Minute <= 30) Then
- lblPeriod.Text = "2 nd Period "
- Dim first As DateTime = CDate("07:50")
- Dim second As DateTime = CDate("08:35")
- Dim current As DateTime
- current = DateTime.Now
- Dim diffBefore As TimeSpan = current - first
- Dim diffAfter As TimeSpan = second - current
- txtPassed.Text = diffBefore.ToString("mm\:ss")
- txtLeft.Text = diffAfter.ToString("mm\:ss")
- '3rd Class
- ElseIf (curT.Hour = 8 And curT.Minute > 40) Or (curT.Hour = 9 And curT.Minute <= 25) Then
- lblPeriod.Text = "3 rd Period "
- '4th Class
- ElseIf (curT.Hour = 9 And curT.Minute > 40) Or (curT.Hour = 10 And curT.Minute <= 30) Then
- lblPeriod.Text = "4 th Period "
- '5th Class
- ElseIf (curT.Hour = 10 And curT.Minute > 35) Or (curT.Hour = 11 And curT.Minute <= 20) Then
- lblPeriod.Text = "5 th Period "
- '6th Class
- ElseIf (curT.Hour = 11 And curT.Minute > 25) Or (curT.Hour = 12 And curT.Minute <= 10) Then
- lblPeriod.Text = "6 th Period "
- Else
- lblPeriod.Text = "Free time"
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement