VB编写打字游戏启动问题
DimGameOnAsBooleanDimDispAsStringDimcTop(1To5),cleft(1To5)AsSinglePrivateSubForm_Load...
Dim GameOn As Boolean
Dim Disp As String
Dim cTop(1 To 5), cleft(1 To 5) As Single
Private Sub Form_Load()
Disp = "abcde"
GameOn = False
End Sub
Private Sub Form_Paint()
Form1.CurrentX = 50
Form1.CurrentY = Pic.Height + 300
Form1.Print "按F2开始,按F3结束"
End Sub
Private Sub Pic_KeyDown(KeyCode As Integer, Shift As Integer)
Dim i As Integer
If KeyCode = 113 Then '如果按下F2键
Pic.Cls
For i = 1 To 5 '5个字符的位置都在屏幕顶部
cTop(i) = 0
Next i
Timer1.Enabled = True '启动时钟
GameOn = True ' 开始练习
ElseIf KeyCode = 114 Then '如果按下F3键
Timer1.Enabled = False '结束练习
Form1.Hide '关闭窗体
End If
End Sub
F2启动没反应 F3有用 展开
Dim Disp As String
Dim cTop(1 To 5), cleft(1 To 5) As Single
Private Sub Form_Load()
Disp = "abcde"
GameOn = False
End Sub
Private Sub Form_Paint()
Form1.CurrentX = 50
Form1.CurrentY = Pic.Height + 300
Form1.Print "按F2开始,按F3结束"
End Sub
Private Sub Pic_KeyDown(KeyCode As Integer, Shift As Integer)
Dim i As Integer
If KeyCode = 113 Then '如果按下F2键
Pic.Cls
For i = 1 To 5 '5个字符的位置都在屏幕顶部
cTop(i) = 0
Next i
Timer1.Enabled = True '启动时钟
GameOn = True ' 开始练习
ElseIf KeyCode = 114 Then '如果按下F3键
Timer1.Enabled = False '结束练习
Form1.Hide '关闭窗体
End If
End Sub
F2启动没反应 F3有用 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询