📄 辩论赛计时系统设计.frm
字号:
Width = 615
End
Begin VB.CommandButton Command5
Caption = "进 入 自由辩论 阶 段"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 975
Left = 120
TabIndex = 3
Top = 5160
Width = 975
End
Begin VB.Timer Timer1
Enabled = 0 'False
Left = 120
Top = 120
End
Begin VB.CommandButton Command4
Caption = "反方计时"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 2
Top = 2760
Width = 975
End
Begin VB.CommandButton Command3
Caption = "正方计时"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 1
Top = 2280
Width = 975
End
Begin VB.CommandButton Command1
Caption = "开始计时"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 0
Top = 3240
Width = 975
End
Begin VB.Line Line1
BorderColor = &H80000004&
X1 = 1200
X2 = 1200
Y1 = 0
Y2 = 5280
End
Begin VB.Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "秒"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5640
TabIndex = 8
Top = 7920
Width = 375
End
Begin VB.Label Label2
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "分"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4560
TabIndex = 7
Top = 7920
Width = 375
End
Begin VB.Label Label14
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "设定时间"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2400
TabIndex = 6
Top = 7920
Width = 1575
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Minutes As Integer
Dim Seconds As Integer
Dim Time As Date
Private Sub Mydisplay()
Minutes = Val(Text2.Text)
Seconds = Val(Text3.Text)
Time = TimeSerial(Hours, Minutes, Seconds)
Label11.Caption = Format$(Time, "nn") & ":" & Format$(Time, "ss")
If Option1.Enabled = True Then '辩论选手时间的设定
Label5.Caption = Text2.Text & ":" & Text3.Text
ElseIf Option2.Enabled = True Then
Label6.Caption = Text2.Text & ":" & Text3.Text
ElseIf Option3.Enabled = True Then
Label7.Caption = Text2.Text & ":" & Text3.Text
ElseIf Option4.Enabled = True Then
Label8.Caption = Text2.Text & ":" & Text3.Text
End If
End Sub
Private Sub Command1_Click() '开始计时
If Minutes = 0 Then '检查时间是否有效
If Seconds = 0 Then
MsgBox ("您还没有设定辩论时间,请在下面输入时间,并点击<确定>。")
End If
End If
If Command3.Enabled = True Then '选择计时方
Timer1.Enabled = True
Timer2.Enabled = False
Else
Timer2.Enabled = True
Timer1.Enabled = False
End If
Command2.Enabled = True
Command1.Enabled = False
End Sub
Private Sub Command2_Click() '交替
Minutes = Val(Text2.Text)
Seconds = Val(Text3.Text)
Time = TimeSerial(Hours, Minutes, Seconds)
If Command3.Enabled = True Then
Command3.Enabled = False
Command4.Enabled = True
Label3.Caption = "反方剩余时间:"
Else
Command4.Enabled = False
Label3.Caption = "正方剩余时间:"
Command3.Enabled = True
End If
Option1.Enabled = True
Option2.Enabled = True
Option3.Enabled = True
Option4.Enabled = True
Command1.Enabled = True
Command6.Enabled = True
Label11.Caption = Text2.Text & ":" & Text3.Text
End Sub
Private Sub Command3_Click()
Command3.Enabled = True '正方有效
Command4.Enabled = False '反方无效
Command1.Enabled = True '开始计时有效
Command2.Enabled = False
Command6.Enabled = True '暂停有效
Option1.Enabled = True
Option2.Enabled = True
Option3.Enabled = True
Option4.Enabled = True
Label3.Caption = "正方剩余时间:"
Label11.Caption = Text2.Text & ":" & Text3.Text
End Sub
Private Sub Command4_Click()
Command4.Enabled = True '反方有效
Command3.Enabled = False '正方无效
Command1.Enabled = True '开始计时有效
Command2.Enabled = False
Command6.Enabled = True '暂停有效
Option1.Enabled = True
Option2.Enabled = True
Option3.Enabled = True
Option4.Enabled = True
Label3.Caption = "反方剩余时间:"
Label11.Caption = Text2.Text & ":" & Text3.Text
End Sub
Private Sub Command6_Click() '暂停
Timer1.Enabled = False
Timer2.Enabled = False
Command2.Enabled = True
Command1.Enabled = True '开始计时有效
End Sub
Private Sub Command7_Click()
'复位
Minutes = 0
Seconds = 0
Time = 0
Text2.Text = "00"
Text3.Text = "00"
Text2.SetFocus
Command3.Enabled = True '正方有效
Command4.Enabled = True '反方有效
Command2.Enabled = False '开始无效
Command7.Enabled = True '复位you效
Command6.Enabled = False '暂停无效
Command1.Enabled = True
End Sub
Private Sub Command8_Click()
Unload Me
Form1.Show
End Sub
Private Sub Form_Load()
Timer1.Interval = 1000
Timer2.Interval = 1000
Minutes = 0
Seconds = 0
Time = 0
Text2.Text = "00" '分钟
Text3.Text = "00" '秒
Command1.Enabled = False '开始计时无效
Command2.Enabled = False
Command6.Enabled = False '暂停无效
Option1.Enabled = False
Option2.Enabled = False
Option3.Enabled = False
Option4.Enabled = False
End Sub
Private Sub Text2_Change()
Mydisplay
End Sub
Private Sub Text3_Change()
Mydisplay
End Sub
Private Sub Timer1_Timer() '正方剩余时间
If (Format$(Time, "nn") & ":" & Format$(Time, "ss")) < "00:12" Then
i = sndPlaySound(App.Path & "/ri.wav", 1)
End If
Timer1.Enabled = False
If (Format$(Time, "nn") & ":" & Format$(Time, "ss")) <> "00:00" Then
Time = DateAdd("s", -1, Time)
Label11.Visible = False
Label11.Caption = Format$(Time, "nn") & ":" & Format$(Time, "ss")
Label11.Visible = True
Timer1.Enabled = True
Else
Timer1.Enabled = False
Beep
Beep
Command3.Enabled = True
End If
End Sub
Private Sub Timer2_Timer() '反方剩余时间
If (Format$(Time, "nn") & ":" & Format$(Time, "ss")) < "00:12" Then
i = sndPlaySound(App.Path & "/ri.wav", 1)
End If
Timer2.Enabled = False
If (Format$(Time, "nn") & ":" & Format$(Time, "ss")) <> "00:00" Then
Time = DateAdd("s", -1, Time)
Label11.Visible = False
Label11.Caption = Format$(Time, "nn") & ":" & Format$(Time, "ss")
Label11.Visible = True
Timer2.Enabled = True
Else
Timer2.Enabled = False
Beep
Beep
Command3.Enabled = True
End If
End Sub
Private Sub Command5_Click()
Unload Me
Form3.Show
End Sub
Private Sub Option1_Click()
Label5.Caption = Text2.Text & ":" & Text3.Text
Label4.Caption = "一辩选手"
End Sub
Private Sub Option2_Click()
Label6.Caption = Text2.Text & ":" & Text3.Text
Label4.Caption = "二辩选手"
End Sub
Private Sub Option3_Click()
Label7.Caption = Text2.Text & ":" & Text3.Text
Label4.Caption = "三辩选手"
End Sub
Private Sub Option4_Click()
Label8.Caption = Text2.Text & ":" & Text3.Text
Label4.Caption = "四辩选手"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -