2个回答
展开全部
在属性里设置timer的enable为false
Dim a, b As Integer
Private Sub Command1_Click()
Timer.enable = True
End Sub
Private Sub Command2_Click()
Timer.enable = False
Unload Me
End Sub
Private Sub Form_Load()
a = 50
b = 50
End Sub
Private Sub Timer1_Timer()
Shape1.Move Shape1.Left + a, Shape1.Top + b
If Shape1.Left + Shape1.Width >= Frame1.Left + Frame1.Width Then
a = -a
End If
If Shape1.Left <= Frame1.Left Then
a = -a
End If
If Shape1.Top <= Frame1.Top Then
b = -b
End If
If Shape1.Top + Shape1.Height >= Frame1.Top + Frame1.Height Then
b = -b
End If
End Sub
这个是小球四处弹的语句,关于速度,更改一下“Shape1.Move Shape1.Left + 100, Shape1.Top + 100”这句里的数值就行了...
Dim a, b As Integer
Private Sub Command1_Click()
Timer.enable = True
End Sub
Private Sub Command2_Click()
Timer.enable = False
Unload Me
End Sub
Private Sub Form_Load()
a = 50
b = 50
End Sub
Private Sub Timer1_Timer()
Shape1.Move Shape1.Left + a, Shape1.Top + b
If Shape1.Left + Shape1.Width >= Frame1.Left + Frame1.Width Then
a = -a
End If
If Shape1.Left <= Frame1.Left Then
a = -a
End If
If Shape1.Top <= Frame1.Top Then
b = -b
End If
If Shape1.Top + Shape1.Height >= Frame1.Top + Frame1.Height Then
b = -b
End If
End Sub
这个是小球四处弹的语句,关于速度,更改一下“Shape1.Move Shape1.Left + 100, Shape1.Top + 100”这句里的数值就行了...
展开全部
http://down.cnzz.cn/DownLinks.aspx?id=67724
稍做修改可达到你要的效果
稍做修改可达到你要的效果
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询