找不到事件“滴答".帮助 [英] Event 'Tick' cannot be found. Help
问题描述
Private Sub Middlewallmove_Tick(发送者为对象,e作为EventArgs)处理MiddleWall.Tick
''移动中间壁球.
Label4.Location =新点(Label4.Location.X,Label4.Location.Y + yVel)
''检查顶墙.
如果Label4.Location.Y< 0然后
Label4.Location =新点(Label4.Location.X,0)
yVel = -yVel
如果结束
''检查底壁.
如果Label4.Location.Y> Me.Height-Label4.Size.Height-45然后
Label4.Location =新点(Label4.Location.X,Me.Height-Label4.Size.Height-45)
yVel = -yVel
如果结束
结束子
Private Sub Cheeselabel_Tick(发送者作为对象,e作为EventArgs)处理BottomWallMove.Tick
Label5.Location =新点(Label5.Location.X + xVel,Label5.Location.Y)
''检查左墙.
如果Label5.Location.X< 619然后
Label5.Location =新点(619,Label5.Location.Y)
xVel = -xVel
如果结束
''检查底壁.
如果Label5.Location.X> 724然后
Label5.Location =新点(724,Label5.Location.Y)
xVel = -xVel
如果结束
End Sub
Private Sub Middlewallmove_Tick(sender As Object, e As EventArgs) Handles MiddleWall.Tick
'' Move the middle wall ball.
Label4.Location = New Point(Label4.Location.X, Label4.Location.Y + yVel)
'' Check for top wall.
If Label4.Location.Y < 0 Then
Label4.Location = New Point(Label4.Location.X, 0)
yVel = -yVel
End If
'' Check for bottom wall.
If Label4.Location.Y > Me.Height - Label4.Size.Height - 45 Then
Label4.Location = New Point(Label4.Location.X, Me.Height - Label4.Size.Height - 45)
yVel = -yVel
End If
End Sub
Private Sub Cheeselabel_Tick(sender As Object, e As EventArgs) Handles BottomWallMove.Tick
Label5.Location = New Point(Label5.Location.X + xVel, Label5.Location.Y)
'' Check for left wall.
If Label5.Location.X < 619 Then
Label5.Location = New Point(619, Label5.Location.Y)
xVel = -xVel
End If
'' Check for bottom wall.
If Label5.Location.X > 724 Then
Label5.Location = New Point(724, Label5.Location.Y)
xVel = -xVel
End If
End Sub
推荐答案
检查MiddleWall和BottomWallMove都是Timer类实例-如果不是,它们将不会发生Tick事件,您将获得错误.
我怀疑应该是... Handles MiddleWallMove.Tick
还是... Handles BottomWall.Tick
,如果您的命名一直一致.
Check that MiddleWall and BottomWallMove are both Timer class instances - if they aren''t, they won''t have a Tick event and you will get the error.
I''d suspect that it should be... Handles MiddleWallMove.Tick
, or... Handles BottomWall.Tick
if you have been consistent in your naming.
这篇关于找不到事件“滴答".帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!