?? form1.frm
字號:
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
ClientHeight = 5100
ClientLeft = 2505
ClientTop = 1590
ClientWidth = 7665
Icon = "Form1.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "Form1.frx":22782
ScaleHeight = 89.959
ScaleMode = 0 'User
ScaleWidth = 135.202
Begin VB.CommandButton Command2
Caption = "重置"
Height = 495
Left = 1680
TabIndex = 6
Top = 4440
Width = 1215
End
Begin VB.Timer Timer2
Interval = 500
Left = 480
Top = 0
End
Begin VB.Timer Timer1
Interval = 300
Left = 0
Top = 0
End
Begin VB.TextBox Text2
BackColor = &H8000000A&
BeginProperty Font
Name = "黑體"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 5040
TabIndex = 2
Top = 1560
Width = 1215
End
Begin VB.TextBox Text1
BackColor = &H8000000A&
BeginProperty Font
Name = "黑體"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3120
TabIndex = 1
Top = 1560
Width = 1215
End
Begin VB.CommandButton Command1
Cancel = -1 'True
Caption = "開始"
Height = 495
Left = 240
TabIndex = 0
Top = 4440
Width = 1215
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "分"
BeginProperty Font
Name = "宋體"
Size = 26.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000011&
Height = 495
Left = 6360
TabIndex = 5
Top = 1560
Width = 495
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "時"
BeginProperty Font
Name = "宋體"
Size = 26.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000011&
Height = 495
Left = 4440
TabIndex = 4
Top = 1560
Width = 495
End
Begin VB.Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "請設置鬧鈴時間:"
BeginProperty Font
Name = "宋體"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000C&
Height = 435
Left = 120
TabIndex = 3
Top = 480
Width = 3615
End
Begin VB.Menu a
Caption = "文件"
Visible = 0 'False
WindowList = -1 'True
Begin VB.Menu a1
Caption = "完成"
End
Begin VB.Menu a2
Caption = "重置"
End
Begin VB.Menu aa
Caption = "-"
End
Begin VB.Menu a3
Caption = "退出"
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwflags As Long) As Long
Private Sub a1_Click()
Command1.Enabled = False 'Command1不可用
If Val(Text1) < 1 Or Val(Text1) > 24 Then
MsgBox "小時數輸入錯誤!", vbExclamation, "提示信息"
Text1 = ""
Text1.SetFocus
Command1.Enabled = True
End If
If Val(Text2) < 1 Or Val(Text2) > 60 Then
MsgBox "分鐘數輸入錯誤", vbExclamation, "提示信息"
Text2 = ""
Text2.SetFocus
End If
Timer1.Enabled = True '運行Timer1
Form1.Visible = False '隱藏窗體
Form2.Show '運行Form2
End Sub
Private Sub a2_Click()
Command1.Enabled = True 'Command1可用
Text1.Text = "" '清空Text1,Text2
Text2.Text = ""
End Sub
Private Sub a3_Click()
End '結束程序
End Sub
Private Sub Command1_Click()
Command1.Enabled = False 'Command1不可用
If Val(Text1) < 1 Or Val(Text1) > 24 Then
MsgBox "小時數輸入錯誤!", vbExclamation, "提示信息"
Text1 = ""
Text1.SetFocus '輸入設置鬧鈴時間
End If
If Val(Text2) < 1 Or Val(Text2) > 60 Then
MsgBox "分鐘數輸入錯誤", vbExclamation, "提示信息"
Text2 = ""
Text2.SetFocus
End If
Timer1.Enabled = True '運行Timer1
Form1.Visible = False '隱藏窗體
Form2.Show '運行Form2
End Sub
Private Sub Command2_Click()
Command1.Enabled = True 'Command1可用
Text1.Text = "" '清空text1,text2
Text2.Text = ""
End Sub
Private Sub Form_Load()
Timer1.Enabled = False 'Timer1不可用 '在窗體標題中顯示系統時間
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then '右鍵彈出菜單
PopupMenu a
End If
End Sub
Private Sub Timer1_Timer()
If Text1 = Hour(Time) Then '設置鬧鈴和聲音
If Text2 = Minute(Time) Then
Form3.Show
Call PlaySound(App.Path + "\鈴聲.wav", 0&, &H0)
End If
End If
End Sub
Function GetWD(ByVal Week As Integer) As String
Select Case Week
Case 1 '編輯系統星期
GetWD = "日"
Case 2
GetWD = "一"
Case 3
GetWD = "二"
Case 4
GetWD = "三"
Case 5
GetWD = "四"
Case 6
GetWD = "五"
Case 7
GetWD = "六"
End Select
End Function
Private Sub Timer2_Timer()
Me.Caption = Year(Date) & "年" & Month(Date) & "月" & Day(Date) & "日 星期" & GetWD(Weekday(Date)) & " 系統時間" & Format$(Time, "hh:mm:ss") '在窗體標題中顯示系統時間
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -