📄 form2.frm
字号:
VERSION 5.00
Begin VB.Form Form2
Caption = "参数设定"
ClientHeight = 3180
ClientLeft = 60
ClientTop = 450
ClientWidth = 4620
LinkTopic = "Form2"
ScaleHeight = 3180
ScaleWidth = 4620
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "保存"
Height = 375
Left = 3120
TabIndex = 10
Top = 2640
Width = 1215
End
Begin VB.TextBox Text1
Height = 270
Left = 1320
TabIndex = 9
Text = "36"
Top = 240
Width = 1935
End
Begin VB.TextBox Text2
Height = 270
Left = 1560
TabIndex = 8
Text = "10:30:00"
Top = 1020
Width = 1000
End
Begin VB.TextBox Text3
Height = 270
Left = 1560
TabIndex = 7
Text = "12:10:00"
Top = 1440
Width = 1000
End
Begin VB.TextBox Text4
Height = 270
Left = 1560
TabIndex = 6
Text = "15:30:00"
Top = 1860
Width = 1000
End
Begin VB.TextBox Text5
Height = 270
Left = 1560
TabIndex = 5
Text = "17:10:00"
Top = 2280
Width = 1000
End
Begin VB.TextBox Text6
Height = 270
Left = 3120
TabIndex = 4
Text = "10:40:00"
Top = 1020
Width = 1000
End
Begin VB.TextBox Text7
Height = 270
Left = 3120
TabIndex = 3
Text = "13:45:00"
Top = 1440
Width = 1000
End
Begin VB.TextBox Text8
Height = 270
Left = 3120
TabIndex = 2
Text = "15:40:00"
Top = 1860
Width = 1000
End
Begin VB.TextBox Text9
Height = 270
Left = 3120
TabIndex = 1
Text = "18:15:00"
Top = 2280
Width = 1000
End
Begin VB.TextBox Text10
Height = 270
Left = 1320
TabIndex = 0
Text = "8:30:00"
Top = 600
Width = 1935
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "节拍设定:"
Height = 180
Left = 120
TabIndex = 25
Top = 285
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "S"
Height = 180
Left = 3360
TabIndex = 24
Top = 285
Width = 90
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "中休设定:"
Height = 180
Left = 120
TabIndex = 23
Top = 1065
Width = 900
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "午餐设定:"
Height = 180
Left = 120
TabIndex = 22
Top = 1485
Width = 900
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "中休设定:"
Height = 180
Left = 120
TabIndex = 21
Top = 1905
Width = 900
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "晚餐设定:"
Height = 180
Left = 120
TabIndex = 20
Top = 2325
Width = 900
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "从"
Height = 180
Left = 1200
TabIndex = 19
Top = 1065
Width = 180
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "从"
Height = 180
Left = 1200
TabIndex = 18
Top = 1485
Width = 180
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "从"
Height = 180
Left = 1200
TabIndex = 17
Top = 1905
Width = 180
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "从"
Height = 180
Left = 1200
TabIndex = 16
Top = 2325
Width = 180
End
Begin VB.Label Label11
AutoSize = -1 'True
Caption = "到"
Height = 180
Left = 2760
TabIndex = 15
Top = 1065
Width = 180
End
Begin VB.Label Label12
AutoSize = -1 'True
Caption = "到"
Height = 180
Left = 2760
TabIndex = 14
Top = 1485
Width = 180
End
Begin VB.Label Label13
AutoSize = -1 'True
Caption = "到"
Height = 180
Left = 2760
TabIndex = 13
Top = 1905
Width = 180
End
Begin VB.Label Label14
AutoSize = -1 'True
Caption = "到"
Height = 180
Left = 2760
TabIndex = 12
Top = 2325
Width = 180
End
Begin VB.Label Label15
AutoSize = -1 'True
Caption = "开始设定:"
Height = 180
Left = 120
TabIndex = 11
Top = 645
Width = 900
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Flag As Integer
Private Sub Command1_Click()
TactTime = CDbl((Trim(Text1.Text)))
IniTime = CDbl(Date + CDate(Trim(Text10.Text)))
MorRestTimeFrom = CDbl(Date + CDate(Trim(Text2.Text)))
MorRestTimeTo = CDbl(Date + CDate(Trim(Text6.Text)))
LauchTimeFrom = CDbl(Date + CDate(Trim(Text3.Text)))
LauchTimeTo = CDbl(Date + CDate(Trim(Text7.Text)))
AftRestTimeFrom = CDbl(Date + CDate(Trim(Text4.Text)))
AftRestTimeTo = CDbl(Date + CDate(Trim(Text8.Text)))
SupTimeFrom = CDbl(Date + CDate(Trim(Text5.Text)))
SupTimeTo = CDbl(Date + CDate(Trim(Text9.Text)))
Flag = 1
PassValue (Flag)
'如果开始时间在休息时间段内,将开始时间设置为休息结束时间
If (IniTime > MorRestTimeFrom And IniTime < MorRestTimeTo) Then
IniTime = MorRestTimeTo
End If
If (IniTime > LauchTimeFrom And IniTime < LauchTimeTo) Then
IniTime = LauchTimeTo
End If
If (IniTime > AftRestTimeFrom And IniTime < AftRestTimeTo) Then
IniTime = AftRestTimeTo
End If
If (IniTime > SupTimeFrom And IniTime < SupTimeTo) Then
IniTime = SupTimeTo
End If
'如果开始时间前存在休息时间,将休息时间置空
If (IniTime > MorRestTimeTo Or IniTime = MorRestTimeTo) Then
MorRestTimeFrom = 0
MorRestTimeTo = 0
End If
If (IniTime > LauchTimeTo Or IniTime = LauchTimeTo) Then
MorRestTimeFrom = 0
MorRestTimeTo = 0
LauchTimeFrom = 0
LauchTimeTo = 0
End If
If (IniTime > AftRestTimeTo Or IniTime = AftRestTimeTo) Then
MorRestTimeFrom = 0
MorRestTimeTo = 0
LauchTimeFrom = 0
LauchTimeTo = 0
AftRestTimeFrom = 0
AftRestTimeTo = 0
End If
If (IniTime > SupTimeTo Or IniTime = SupTimeTo) Then
MorRestTimeFrom = 0
MorRestTimeTo = 0
LauchTimeFrom = 0
LauchTimeTo = 0
AftRestTimeFrom = 0
AftRestTimeTo = 0
SupTimeFrom = 0
SupTimeTo = 0
End If
Unload Me
End Sub
Private Sub Form_Load()
Flag = 0
PassValue (Flag)
End Sub
Function PassValue(ByVal Flag As Integer)
Static TmpTact, TmpIni, TmpMorFrom, TmpMorTo, TmpLauFrom, TmpLauTo, TmpAftFrom, TmpAftTo, TmpSupFrom, TmpSupTo As String
If TmpTact = "" And TmpIni = "" And TmpMorFrom = "" And TmpMorTo = "" And TmpLauFrom = "" And _
TmpLauTo = "" And TmpAftFrom = "" And TmpAftTo = "" And TmpSupFrom = "" And TmpSupTo = "" Then '初始化静态变量
TmpTact = 36
TmpIni = #8:30:00 AM#
TmpMorFrom = #10:30:00 AM#
TmpMorTo = #10:40:00 AM#
TmpLauFrom = #12:10:00 PM#
TmpLauTo = #1:45:00 PM#
TmpAftFrom = #3:30:00 PM#
TmpAftTo = #3:40:00 PM#
TmpSupFrom = #5:10:00 PM#
TmpSupTo = #6:15:00 PM#
Else
If Flag = 1 Then '保存设置
TmpTact = Text1.Text
TmpIni = Text10.Text
TmpMorFrom = Text2.Text
TmpMorTo = Text6.Text
TmpLauFrom = Text3.Text
TmpLauTo = Text7.Text
TmpAftFrom = Text4.Text
TmpAftTo = Text8.Text
TmpSupFrom = Text5.Text
TmpSupTo = Text9.Text
End If
If Flag = 0 Then '显示前一次保存的设置
Text1.Text = TmpTact
Text10.Text = TmpIni
Text2.Text = TmpMorFrom
Text6.Text = TmpMorTo
Text3.Text = TmpLauFrom
Text7.Text = TmpLauTo
Text4.Text = TmpAftFrom
Text8.Text = TmpAftTo
Text5.Text = TmpSupFrom
Text9.Text = TmpSupTo
End If
End If
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -