📄 frmmain.frm
字号:
VERSION 5.00
Begin VB.Form FrmMain
BackColor = &H80000012&
BorderStyle = 1 'Fixed Single
ClientHeight = 11115
ClientLeft = 15
ClientTop = 15
ClientWidth = 15240
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 11115
ScaleWidth = 15240
StartUpPosition = 2 '屏幕中心
WindowState = 2 'Maximized
Begin VB.Timer Timer2
Enabled = 0 'False
Interval = 500
Left = 240
Top = 2880
End
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 20
Left = 360
Top = 2040
End
Begin VB.CommandButton Command1
BackColor = &H0000FF00&
Caption = "开 始"
BeginProperty Font
Name = "隶书"
Size = 36
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 360
Style = 1 'Graphical
TabIndex = 1
Top = 10200
Width = 2655
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "20"
BeginProperty Font
Name = "黑体"
Size = 600
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000FFFF&
Height = 12015
Left = 1560
TabIndex = 0
Top = 0
Width = 12030
End
End
Attribute VB_Name = "FrmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Flag As Integer
Private Sub Command1_Click()
If Command1.Caption = "开 始" Then
rc = sndPlaySound(App.Path & "\xuan.wav", SND_ASYNC)
Command1.Caption = "停 止"
Timer2.Enabled = False
Command1.BackColor = vbRed
Timer1.Interval = 20
Timer1.Enabled = True
Else
Dim ssad As Single
Command1.Caption = "开 始"
Command1.BackColor = vbGreen
Command1.Enabled = False
rc = sndPlaySound(App.Path & "\ting.WAV", SND_ASYNC)
For i = 1 To 3
'Timer1.Enabled = False
Timer1.Interval = i * i * 20
Timer1.Enabled = True
ssad = i * i * 20 / 1000
waitTime (ssad)
Next
Timer1.Enabled = False
Timer2.Enabled = True
Command1.Enabled = True
End If
End Sub
Private Sub waitTime(Wttime As Single)
Dim nowTm As Single
nowTm = Timer
Do While Timer - nowTm < Wttime
DoEvents
Loop
End Sub
Private Sub Form_DblClick()
End
End Sub
Private Sub Timer1_Timer()
Randomize '初始化随机数
sj1 = Int(Rnd * 3) + 1
ys1 = Int(Rnd * 6) + 9
If sj1 = 1 Then
Label1.Caption = "10"
ElseIf sj1 = 2 Then
Label1.Caption = "20"
ElseIf sj1 = 3 Then
Label1.Caption = "30"
Else
Label1.Caption = "10"
End If
Label1.ForeColor = QBColor(ys1)
End Sub
Private Sub Timer2_Timer()
If Flag = 0 Then
Label1.ForeColor = vbYellow
Flag = 1
Else
Flag = 0
Label1.ForeColor = vbRed
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -