?? 辯論賽計時系統設計.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 + -