网上科普有关“vb期末考试知识点总结”话题很是火热,小编也是针对vb期末考试知识点总结寻找了一些与之相关的一些信息进行分析,如果能碰巧解决你现在面临的问题,希望能够帮助到您。
楼主,对你的程序已进行了修改,但还存在一些错误,如果还有问题要问,我的QQ是110807087
Option Explicit
Dim a As String
Dim n As Integer
Dim j As Integer
Dim d
Dim ii As Integer
Dim score As Integer
Private Sub Command1_Click()
Picture1.SetFocus
Label1(0) = ""
Label3 = ""
Command2.Enabled = True
Timer1.Enabled = True
Timer2.Enabled = True
Picture1.SetFocus
Label6.Caption = "你选择了第" & VScroll1.Value & "关"
n = 0
Label3.Caption = n
End Sub
Private Sub Command2_Click()
If Timer1.Enabled = True Then
Timer1.Enabled = False
If Timer2.Enabled = True Then
Timer1.Enabled = False
Command2.Caption = "继续"
Else
Timer2.Enabled = True
Command2.Caption = "暂停"
End If
Picture1.SetFocus
Else
Timer1.Enabled = True
End If
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Form_Load()
On Error Resume Next
Dim i As Integer
Dim E As Integer
Picture1.Height = 6500
Picture1.Width = 11500
WindowState = 2
score = 0
For i = 1 To 10
Load Label1(i)
Label1(i).Top = -700
Label1(i).Visible = True
Next i
Randomize
n = 0
'ProgressBar1.Value = 20
Command2.Enabled = False
E = VScroll1.Value
Label4.Caption = " 目前你在第" & E & "关" & vbCrLf _
& vbCrLf & _
" 每得分50加一关,得-20分游戏结束!"
Timer1.Enabled = False
Timer2.Enabled = False
Label5.Caption = 60
Timer1.Interval = 100
For i = 1 To 10
a = Chr$(Int(Rnd * 26 + 97))
Label1(i).Caption = a
Next i
d = 50
For i = 1 To 10
Label1(i).Left = 600 * i
Label1(i).Font.Size = 36
Label1(i).ForeColor = Int(Rnd * vbRed + Rnd * vbGreen + Rnd * vbBlue)
Next i
' Randomize
End Sub
Private Sub Picture1_KeyPress(KeyAscii As Integer)
Dim i As Integer
Static b
For ii = 1 To 10
If KeyAscii = Asc(Label1(ii).Caption) Then
Call CS
End If
Next ii
' n = n + 1
' Label3.Caption = n
' 'ProgressBar1.Value = ProgressBar1.Value + 4
' Else
' n = n - 1
' Label3.Caption = n
' 'ProgressBar1.Value = ProgressBar1.Value - 4
' Call CS
'End If
End Sub
Private Sub Timer1_Timer()
Dim i As Integer
Dim b As Integer
Static C
d = VScroll1.Value
Static E
Randomize
For i = 1 To 10
Label1(i).Top = Label1(i).Top + d * 30
'
If Label1(i).Top > Picture1.Height Then
n = n + 1
' Label3.Caption = n
' ProgressBar1.Value = ProgressBar1.Value - 4
If n <= -20 Then
' ' If ProgressBar1.Value <= 0 Then
b = MsgBox("你已经失败了,不要紧,下次再来!是否重新开始游戏", _
vbYesNo + vbQuestion, "要加倍努力")
If b = 6 Then Form_Load
If b = 7 Then End
End If
Label1(i).Top = -150
a = Chr$(Int(Rnd * 26 + 97))
Label1(i).Caption = a
End If
If score >= 50 Then
' If ProgressBar1.Value >= 50 Then
b = MsgBox("恭喜你过关了,是否进入下一关?", vbYesNo, "打字练习")
If b = 6 Then
VScroll1.Value = VScroll1.Value + 1
Command1.SetFocus
Form_Load
End If
If b = 7 Then End
End If
If n <= -20 Then
' If ProgressBar1.Value <= 0 Then
b = MsgBox("你已经失败了,不要紧,下次再来!是否重新开始游戏", _
vbYesNo + vbQuestion, "要加倍努力")
If b = 6 Then Form_Load
Command1.SetFocus
If b = 7 Then End
End If
Next i
End Sub
Public Sub CS()
Dim f As Integer
Label1(ii).Top = -50
Randomize
a = Chr$(Int(Rnd * 26 + 97))
Label1(ii).Caption = a
f = Int(Rnd * 11100 + 100)
Label1(ii).Left = f
Label1(ii).ForeColor = Int(Rnd * vbRed + Rnd * vbGreen + Rnd * vbBlue)
score = score + 1
Label3.Caption = Str(score)
End Sub
Private Sub Timer2_Timer()
Dim i As Integer
'Timer2.Enabled = True
Label5.Caption = Val(Label5.Caption) - 1
If Val(Label5.Caption) <= 0 Then
Timer1.Enabled = False
For j = 1 To 10
Label1(j).Caption = ""
Next j
i = MsgBox("您的时间已经到了,不要紧,下次再来!是否重新开始游戏", _
vbYesNo + vbQuestion, "要加倍努力")
'If i = 1 Then
' Command1_Click
' Timer2.Enabled = False
'Else
' Timer2.Enabled = False
'End If
End If
End Sub
Private Sub VScroll1_Change()
Dim E As Integer
Command1.Enabled = True
Label6.Caption = "你选择了第" & VScroll1.Value & "关"
E = VScroll1.Value
Label4.Caption = " 目前你在第" & E & "关" & vbCrLf _
& vbCrLf & _
" 每答对50个加一关,答错25个游戏结束!"
End Sub
关于“vb期末考试知识点总结”这个话题的介绍,今天小编就给大家分享完了,如果对你有所帮助请保持对本站的关注!
本文来自作者[admin]投稿,不代表东南号立场,如若转载,请注明出处:https://dnflianfa.com/cshi/202501-7346.html
评论列表(4条)
我是东南号的签约作者“admin”!
希望本篇文章《vb期末考试知识点总结》能对你有所帮助!
本站[东南号]内容主要涵盖:国足,欧洲杯,世界杯,篮球,欧冠,亚冠,英超,足球,综合体育
本文概览:网上科普有关“vb期末考试知识点总结”话题很是火热,小编也是针对vb期末考试知识点总结寻找了一些与之相关的一些信息进行分析,如果能碰巧解决你现在面临的问题,希望能够帮助到您。楼...