📄 form2.frm
字号:
VERSION 5.00
Begin VB.Form Form2
BackColor = &H8000000B&
BorderStyle = 3 'Fixed Dialog
Caption = "定时设置"
ClientHeight = 1860
ClientLeft = 150
ClientTop = 435
ClientWidth = 4935
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1860
ScaleWidth = 4935
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text3
Appearance = 0 'Flat
Height = 300
Left = 3240
TabIndex = 20
Top = 1575
Width = 1695
End
Begin VB.CheckBox Check2
Caption = "设为不可更改的设置"
Height = 375
Left = 120
TabIndex = 19
Top = 1560
Value = 1 'Checked
Width = 1935
End
Begin VB.Timer Timer2
Enabled = 0 'False
Interval = 100
Left = 3840
Top = 1800
End
Begin VB.CommandButton Command5
Caption = "关闭窗口"
Height = 375
Left = 3960
TabIndex = 18
Top = 1200
Width = 892
End
Begin VB.TextBox Text2
Height = 330
Left = 3120
TabIndex = 16
Top = 360
Width = 1695
End
Begin VB.CommandButton Command4
Caption = "注销"
Height = 375
Left = 3000
TabIndex = 15
Top = 1200
Width = 615
End
Begin VB.CommandButton Command3
Caption = "强行关闭"
Height = 375
Left = 1920
TabIndex = 14
Top = 1200
Width = 975
End
Begin VB.ComboBox Combo3
Height = 300
Left = 3360
TabIndex = 12
Text = "Combo3"
Top = 800
Width = 736
End
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 100
Left = 3240
Top = 1320
End
Begin VB.TextBox Text1
BeginProperty DataFormat
Type = 1
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 1
EndProperty
Height = 270
Left = 3600
TabIndex = 10
Text = "3"
Top = 0
Width = 255
End
Begin VB.CheckBox Check1
Caption = "在关闭"
Height = 255
Left = 2760
TabIndex = 9
Top = 0
Value = 1 'Checked
Width = 855
End
Begin VB.CommandButton Command2
Caption = "重启"
Height = 375
Left = 0
TabIndex = 8
Top = 1200
Width = 610
End
Begin VB.OptionButton Option1
Caption = "系统在下列时间后关闭"
ForeColor = &H000000FF&
Height = 255
Index = 1
Left = 120
TabIndex = 7
Top = 90
Value = -1 'True
Width = 2295
End
Begin VB.OptionButton Option1
Caption = "系统在下列时间关闭"
ForeColor = &H00000000&
Height = 255
Index = 0
Left = 120
TabIndex = 6
Top = 360
Width = 1935
End
Begin VB.CommandButton Command1
Caption = "关闭计算机"
Height = 375
Left = 720
TabIndex = 5
Top = 1200
Width = 1030
End
Begin VB.ComboBox Combo2
Height = 300
Left = 2040
TabIndex = 3
Text = "Combo2"
Top = 800
Width = 735
End
Begin VB.ComboBox Combo1
Height = 300
Left = 840
TabIndex = 1
Text = "Combo1"
Top = 800
Width = 615
End
Begin VB.Label Label7
Caption = "消息窗口:"
Height = 375
Left = 2280
TabIndex = 21
Top = 1600
Width = 855
End
Begin VB.Label Label6
Caption = "倒计时:"
Height = 375
Left = 2400
TabIndex = 17
Top = 390
Width = 855
End
Begin VB.Label Label5
Caption = "秒时"
Height = 255
Left = 4200
TabIndex = 13
Top = 840
Width = 615
End
Begin VB.Label Label4
Caption = "分钟前提醒"
Height = 255
Left = 3960
TabIndex = 11
Top = 0
Width = 975
End
Begin VB.Label Label3
Caption = "分"
Height = 255
Left = 2880
TabIndex = 4
Top = 840
Width = 615
End
Begin VB.Label Label2
Caption = "点"
Height = 255
Left = 1560
TabIndex = 2
Top = 840
Width = 375
End
Begin VB.Label Label1
Caption = "定时在:"
Height = 375
Left = 120
TabIndex = 0
Top = 795
Width = 720
End
Begin VB.Menu form1menu
Caption = "form1menu"
Visible = 0 'False
Begin VB.Menu color
Caption = "外观设置"
End
Begin VB.Menu set
Caption = "定时设置"
End
Begin VB.Menu dsf
Caption = "-"
End
Begin VB.Menu notyfy
Caption = "提醒"
End
Begin VB.Menu nonenotify
Caption = "不提醒"
End
Begin VB.Menu sdf
Caption = "-"
End
Begin VB.Menu backtime
Caption = "显示倒计时"
End
Begin VB.Menu nonbacktime
Caption = "不显示倒计时"
End
Begin VB.Menu dsfsf
Caption = "-"
End
Begin VB.Menu about
Caption = "关于"
End
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub about_Click()
MsgBox "Cool Time 1.01" & Chr(13) & "zwky90090@163.com", vbDefaultButton1, "版本"
End Sub
Private Sub backtime_Click()
CoolTime.Height = 560
End Sub
Private Sub color_Click()
Dim i1, i2, i3 As Integer
Dim i As String
i = InputBox("请输入色彩RGB值:!,分隔")
i = Trim(i)
i1 = Int(Left(i, InStr(i, ",")))
i2 = Int(Mid(i, InStr(i, ",") + 1, InStrRev(i, ",") - InStr(i, ",")))
i3 = Int(Mid(i, InStrRev(i, ",") + 1, Len(i)))
CoolTime.Label3.BackColor = RGB(i1, i2, i3)
End Sub
Private Sub Command1_Click()
If Option1(0).Value = True Then
t1a = Int(Combo1.Text)
t1b = Int(Combo2.Text)
t1c = Int(Combo3.Text)
If t1c < 10 Then
str1(0) = "0" & Trim(Str(t1c))
Else
str1(0) = Trim(Str(t1c))
End If
If t1b < 10 Then
str1(1) = "0" & Trim(Str(t1b))
Else
str1(1) = Trim(Str(t1b))
End If
str1(2) = Trim(Str(t1a))
time1 = str1(2) & ":" & str1(1) & ":" & str1(0)
Else
t1a = Int(Combo1.Text)
t1b = Int(Combo2.Text)
t1c = Int(Combo3.Text)
t1a = t1a + Int(Hour(Time()))
t1b = t1b + Int(Minute(Time()))
t1c = t1c + Int(Second(Time()))
If t1c > 60 Then
t1c = t1c - 60
t1b = t1b + 1
End If
If t1b > 60 Then
t1b = t1b - 60
t1a = t1a + 1
End If
If t1a > 24 Then
t1a = t1a - 24
End If
If t1c < 10 Then
str1(0) = Trim("0" & Str(t1c))
Else
str1(0) = Trim(Str(t1c))
End If
If t1b < 10 Then
str1(1) = Trim("0" & Str(t1b))
Else
str1(1) = Trim(Str(t1b))
End If
If t1a > 24 Then
t1a = t1a - 24
str1(2) = Trim(Str(t1a))
Else
str1(2) = Trim(Str(t1a))
End If
time1 = str1(2) & ":" & str1(1) & ":" & str1(0)
End If
If Check1.Value = 1 Then
If Option1(0).Value = True Then
If Int(Combo2.Text) - Int(Text1.Text) < 0 Then
time2 = Trim(Str(Int(Combo1.Text) - 1)) & ":" & Trim(Str(60 + Int(Combo2.Text) - Int(Text1.Text))) & ":" & Trim(Combo3.Text)
Else
time2 = Trim(Combo1.Text) & ":" & Trim(Str(Int(Combo2.Text) - Int(Text1.Text))) & ":" & Trim(Combo3.Text)
End If
Else
If Int(Trim(Str(60 + Int(Minute(Time())) + Int(Combo2.Text) - Int(Text1.Text)))) - Int(Text1.Text) < 0 Then
time2 = Trim(Str(Int(Hour(Time())) + Int(Combo1.Text) - 1)) & ":" & Trim(Str(60 + Int(Minute(Time())) + Int(Combo2.Text) - Int(Text1.Text))) & ":" & Trim(Str(Int(Second(Time())) + Int(Combo3.Text)))
Else
time2 = Trim(Str(Int(Hour(Time())) + Int(Combo1.Text))) & ":" & Trim(Str(Int(Minute(Time())) + Int(Combo2.Text) - Int(Text1.Text))) & ":" & Trim(Str(Int(Second(Time())) + Int(Combo3.Text)))
End If
End If
End If
If Option1(0).Value = True Then
ta = Int(Hour(Time()))
tb = Int(Minute(Time()))
tc = Int(Second(Time()))
ta = Int(Combo1.Text) - ta
tb = Int(Combo2.Text) - tb
tc = Int(Combo3.Text) - tc
If tc < 0 Then
tc = tc + 60
tb = tb - 1
End If
If tb < 0 Then
tb = tb + 60
ta = ta - 1
End If
If ta < 0 Then
ta = ta + 24
End If
bktime = Int(ta) * 3600 + Int(tb) * 60 + Int(tc)
Else
bktime = Int(Combo1.Text) * 3600 + Int(Combo2.Text) * 60 + Int(Combo3.Text)
End If
opt = 2
Timer1.Enabled = True
Timer2.Enabled = True
If Check2.Value = 1 Then
Form2.Option1(0).Enabled = False
Form2.Option1(1).Enabled = False
Form2.Command1.Enabled = False
Form2.Command2.Enabled = False
Form2.Command3.Enabled = False
Form2.Command4.Enabled = False
End If
Form2.Caption = "系统在" & time1 & "关闭计算机"
End Sub
Private Sub Command2_Click()
If Option1(0).Value = True Then
t1a = Int(Combo1.Text)
t1b = Int(Combo2.Text)
t1c = Int(Combo3.Text)
If t1c < 10 Then
str1(0) = "0" & Trim(Str(t1c))
Else
str1(0) = Trim(Str(t1c))
End If
If t1b < 10 Then
str1(1) = "0" & Trim(Str(t1b))
Else
str1(1) = Trim(Str(t1b))
End If
str1(2) = Trim(Str(t1a))
time1 = str1(2) & ":" & str1(1) & ":" & str1(0)
Else
t1a = Int(Combo1.Text)
t1b = Int(Combo2.Text)
t1c = Int(Combo3.Text)
t1a = t1a + Int(Hour(Time()))
t1b = t1b + Int(Minute(Time()))
t1c = t1c + Int(Second(Time()))
If t1c > 60 Then
t1c = t1c - 60
t1b = t1b + 1
End If
If t1b > 60 Then
t1b = t1b - 60
t1a = t1a + 1
End If
If t1a > 24 Then
t1a = t1a - 24
End If
If t1c < 10 Then
str1(0) = Trim("0" & Str(t1c))
Else
str1(0) = Trim(Str(t1c))
End If
If t1b < 10 Then
str1(1) = Trim("0" & Str(t1b))
Else
str1(1) = Trim(Str(t1b))
End If
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -