VB6.0编译错误:必选参数是什么意思?急!!!
DimnAsIntegerPrivateSubCommand1_Click()IfCommand1.Caption="start"ThenIfLabel1.Caption...
Dim n As Integer
Private Sub Command1_Click()
If Command1.Caption = "start" Then
If Label1.Caption = "stop" Then
Timer1.Enabled = True
End If
Else
Command1.Caption = "start"
Form -Load
End If
End Sub
Private Sub Command1_KeyDown(KeyCode As Integer, Shift As Integer)
Static r As Integer, t As Integer
If Label1.Caption = "run" Then
Select Case KeyCode
Case vekeya: r = 1
Case vbKeyS: If r = 1 Then r = 2
Case 186: t = 1
Case 222: If t = 1 Then t = 2
End Select
If r = 2 Then
Image2.Left = Image2.Left + Picture1.Width / 20
r = 0
If Image2.Left >= Picture.Width - Image2.Width Then
Image1.Picture = Image2.Picture
Image1.Visible = True
Label1.Caption = "Chicken win!"
Command1.Caption = "Play again"
End If
ElseIf t = 2 Then
Image3.Left = Image3.Left + Picture2.Width / 20
t = 0
If Image3.Left >= Picture2.Width - Image3.Width Then
Image1.Picture = Image3.Picture
Image1.Visible = True
Label1.Caption = "Wolf win"
Command1.Caption = "Play again"
End If
End If
End If
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
Label1.Caption = "stop"
Image1.Visible = False
Image2.Left = 0
Image3.Left = 0
Picture1.TabStop = False
Picture2.TabStop = False
n = 5
End Sub
Private Sub Timer1_Timer()
If n <> 0 Then
Label1.Caption = LTrim(Str(n))
Else
Label1.Caption = "run"
Timer1.Enabled = False
End If
n = n - 1
End Sub
这段程序编译的时候说是编译错误:必选参数
Private Sub Command1_Click()
这句话显示黄色,是不是这句话错了?应该怎么改?高手进来指导下吧,急!!! 展开
Private Sub Command1_Click()
If Command1.Caption = "start" Then
If Label1.Caption = "stop" Then
Timer1.Enabled = True
End If
Else
Command1.Caption = "start"
Form -Load
End If
End Sub
Private Sub Command1_KeyDown(KeyCode As Integer, Shift As Integer)
Static r As Integer, t As Integer
If Label1.Caption = "run" Then
Select Case KeyCode
Case vekeya: r = 1
Case vbKeyS: If r = 1 Then r = 2
Case 186: t = 1
Case 222: If t = 1 Then t = 2
End Select
If r = 2 Then
Image2.Left = Image2.Left + Picture1.Width / 20
r = 0
If Image2.Left >= Picture.Width - Image2.Width Then
Image1.Picture = Image2.Picture
Image1.Visible = True
Label1.Caption = "Chicken win!"
Command1.Caption = "Play again"
End If
ElseIf t = 2 Then
Image3.Left = Image3.Left + Picture2.Width / 20
t = 0
If Image3.Left >= Picture2.Width - Image3.Width Then
Image1.Picture = Image3.Picture
Image1.Visible = True
Label1.Caption = "Wolf win"
Command1.Caption = "Play again"
End If
End If
End If
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
Label1.Caption = "stop"
Image1.Visible = False
Image2.Left = 0
Image3.Left = 0
Picture1.TabStop = False
Picture2.TabStop = False
n = 5
End Sub
Private Sub Timer1_Timer()
If n <> 0 Then
Label1.Caption = LTrim(Str(n))
Else
Label1.Caption = "run"
Timer1.Enabled = False
End If
n = n - 1
End Sub
这段程序编译的时候说是编译错误:必选参数
Private Sub Command1_Click()
这句话显示黄色,是不是这句话错了?应该怎么改?高手进来指导下吧,急!!! 展开
1个回答
展开全部
Private Sub Command1_Click()
If Command1.Caption = "start" Then
If Label1.Caption = "stop" Then
Timer1.Enabled = True
End If
Else
Command1.Caption = "start"
Form_Load '''这里的短横改为下划线
End If
End Sub
If Command1.Caption = "start" Then
If Label1.Caption = "stop" Then
Timer1.Enabled = True
End If
Else
Command1.Caption = "start"
Form_Load '''这里的短横改为下划线
End If
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询