打地鼠 VB 程序代码打地鼠 VB 程序代码打地鼠 VB 程序代码 1 Private Const totaltime = 30 Private sum As Long, nt As Long Private Sub Command1_Click() 结束按钮 End End Sub Private Sub timer1_timer() If Timernt > totaltime Then Timer1
Enabled = False MsgBox "时间到
" Text1
Text = "您一共打中 " 定义变化次数 打中次数 Private Sub a_Click() Timer1
Interval = 1000 新手 End Sub Private Sub b_Click() Timer1
Interval = 700 达人 End Sub Private Sub c_Click() Timer1
Interval = 500 老手 End Sub Private Sub Command1_Click() If Command1
Caption = "继续" Then Timer1
Enabled = True Label2
Caption = "运行中
" Else Timer1
Enabled = True 时间启动 allnum = 0 变化次数初始为 0 oknum = 0 打中次数初始为 0 Label2
Caption = "运行中
" End If Command1
Enabled = False Command2
Enabled = True End Sub Private Sub Command2_Click() Timer1
Enabled = False 暂停 Label2
Caption = "暂停中
" Command1