?? form1.frm
字號(hào):
VERSION 5.00
Begin VB.Form Form1
AutoRedraw = -1 'True
BorderStyle = 1 'Fixed Single
Caption = "倒計(jì)時(shí)"
ClientHeight = 2745
ClientLeft = 3270
ClientTop = 1635
ClientWidth = 3990
ControlBox = 0 'False
Icon = "FORM1.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
PaletteMode = 1 'UseZOrder
ScaleHeight = 2745
ScaleWidth = 3990
Begin VB.Timer Timer1
Enabled = 0 'False
Left = 480
Top = 840
End
Begin VB.CommandButton Command4
Caption = "退出"
Height = 375
Left = 2760
TabIndex = 8
Top = 2160
Width = 735
End
Begin VB.CommandButton Command3
Caption = "置零"
Enabled = 0 'False
Height = 375
Left = 1920
TabIndex = 7
Top = 2160
Width = 615
End
Begin VB.CommandButton Command2
Caption = "暫停"
Height = 375
Left = 1200
TabIndex = 6
Top = 2160
Width = 615
End
Begin VB.CommandButton Command1
Caption = "開(kāi)始"
Height = 375
Left = 480
TabIndex = 5
Top = 2160
Width = 615
End
Begin VB.TextBox Text3
Alignment = 2 'Center
Height = 285
Left = 2520
MultiLine = -1 'True
TabIndex = 4
Top = 480
Width = 375
End
Begin VB.TextBox Text2
Alignment = 2 'Center
Height = 285
Left = 1800
MultiLine = -1 'True
TabIndex = 3
Top = 480
Width = 375
End
Begin VB.TextBox Text1
Alignment = 2 'Center
Height = 285
Left = 1080
MultiLine = -1 'True
TabIndex = 2
Top = 480
Width = 375
End
Begin VB.Label Label6
Alignment = 2 'Center
Caption = "秒"
Height = 255
Left = 2520
TabIndex = 12
Top = 840
Width = 375
End
Begin VB.Label Label5
Alignment = 2 'Center
Caption = "分鐘"
Height = 255
Left = 1800
TabIndex = 11
Top = 840
Width = 375
End
Begin VB.Label Label4
Alignment = 2 'Center
Caption = "小時(shí)"
Height = 255
Left = 1080
TabIndex = 10
Top = 840
Width = 375
End
Begin VB.Label Label3
Alignment = 2 'Center
Caption = "剩余時(shí)間"
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1200
TabIndex = 9
Top = 1080
Width = 1575
End
Begin VB.Label Label2
Alignment = 2 'Center
Caption = "設(shè)定時(shí)間"
Height = 255
Left = 1080
TabIndex = 1
Top = 120
Width = 1695
End
Begin VB.Label Label1
Alignment = 2 'Center
BackColor = &H0000FFFF&
Caption = "00:00:00"
BeginProperty Font
Name = "Arial"
Size = 14.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Left = 1200
TabIndex = 0
Top = 1560
Width = 1575
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Hours As Integer
Dim Minutes As Integer
Dim Seconds As Integer
Dim Time As Date
Private Sub Mydisplay()
'記錄用戶的輸入
Hours = Val(Text1.Text)
Minutes = Val(Text2.Text)
Seconds = Val(Text3.Text)
'將數(shù)字轉(zhuǎn)變?yōu)闀r(shí)間
Time = TimeSerial(Hours, Minutes, Seconds)
'在Label1中顯示時(shí)間
Label1.Caption = Format$(Time, "hh") & ":" & Format$(Time, "nn") & ":" & Format$(Time, "ss")
End Sub
Private Sub Command1_Click()
'激活Timer控件
Timer1.Enabled = True
Command3.Enabled = False
End Sub
Private Sub Command2_Click()
'暫停時(shí)間記錄
Timer1.Enabled = False
Command3.Enabled = True
End Sub
Private Sub Command3_Click()
'重置時(shí)間
Hours = 0
Minutes = 0
Seconds = 0
Time = 0
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text1.SetFocus 'put curser in the hour text box
End Sub
Private Sub Command4_Click()
'退出程序
End
End Sub
Private Sub Form_Load()
'使窗口居中
Form1.Top = (Screen.Height - Form1.Height) / 2
Form1.Left = (Screen.Width - Form1.Width) / 2
Timer1.Interval = 1000
Hours = 0
Minutes = 0
Seconds = 0
Time = 0
End Sub
Private Sub Text1_Change()
Mydisplay
End Sub
Private Sub Text2_Change()
Mydisplay
End Sub
Private Sub Text3_Change()
Mydisplay
End Sub
Private Sub Timer1_Timer()
'動(dòng)態(tài)改變時(shí)間
Timer1.Enabled = False
If (Format$(Time, "hh") & ":" & Format$(Time, "nn") & ":" & Format$(Time, "ss")) <> "00:00:00" Then 'Counter to continue loop until 0
Time = DateAdd("s", -1, Time)
Label1.Visible = False
Label1.Caption = Format$(Time, "hh") & ":" & Format$(Time, "nn") & ":" & Format$(Time, "ss")
Label1.Visible = True
Timer1.Enabled = True
Else
Timer1.Enabled = False
Beep
Beep
Command3.Enabled = True
End If
End Sub
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -