This repository has been archived by the owner on Feb 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrmSchoolTime.frm
executable file
·105 lines (93 loc) · 3.1 KB
/
frmSchoolTime.frm
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
VERSION 5.00
Begin VB.Form frmSchoolTime
Appearance = 0 'Flat
AutoRedraw = -1 'True
BackColor = &H80000003&
BorderStyle = 0 'None
Caption = "School Time"
ClientHeight = 480
ClientLeft = 12750
ClientTop = 7845
ClientWidth = 1725
BeginProperty Font
Name = "Helvetica"
Size = 18
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "frmSchoolTime.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Moveable = 0 'False
ScaleHeight = 480
ScaleWidth = 1725
ShowInTaskbar = 0 'False
Begin VB.Timer tmr_Time
Interval = 1000
Left = 240
Top = 0
End
Begin VB.Label lblTime
Alignment = 1 'Right Justify
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BackStyle = 0 'Transparent
BeginProperty Font
Name = "Helvetica"
Size = 12.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 285
Left = 1545
TabIndex = 0
Top = 120
Width = 75
End
End
Attribute VB_Name = "frmSchoolTime"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Form_DblClick()
'Closes the program when double clicked
End
End Sub
Private Sub lblTime_DblClick()
'Closes the program when double clicked
End
End Sub
Private Sub Form_Load()
'Sets form in the bottom right corner of the screen
Me.Top = Screen.Height - Me.Height - 510
Me.Left = Screen.Width - Me.Width
'Prints a value before the form is shown, so the user doesn't see a blank window for the first second
Call tmr_Time_Timer
End Sub
Private Sub tmr_Time_Timer()
Cls
'Declare variables
'CurrTime is the current time
Dim CurrTime As Date
'Gets and adjusts time
CurrTime = DateAdd("s", -30, DateAdd("n", -5, Now))
'Outputs the time
lblTime.Caption = Format$(CurrTime, "h:mm:ss AMPM")
'Changes the color to green if it is currently green screen, otherwise it stays blue
If (Hour(CurrTime) = 9 And Minute(CurrTime) >= 40 And Minute(CurrTime) < 45) Or (Hour(CurrTime) = 11 And Minute(CurrTime) < 45) Or (Hour(CurrTime) = 13 And Minute(CurrTime) < 5) Then
Me.BackColor = &H8000&
Else
Me.BackColor = &H80000003
End If
End Sub