vb6里,想让一个shape控件自己动起来,要怎么写代码?
展开全部
用一个定时器实现。
Option Explicit
Dim x As Long
Private Sub Form_Load()
Timer1.Interval = 500
x = Shape1.Left
End Sub
Private Sub Timer1_Timer()
x = x + 100
If x > Me.Width Then x = 0
Shape1.Move x, Shape1.Top
End Sub
Option Explicit
Dim x As Long
Private Sub Form_Load()
Timer1.Interval = 500
x = Shape1.Left
End Sub
Private Sub Timer1_Timer()
x = x + 100
If x > Me.Width Then x = 0
Shape1.Move x, Shape1.Top
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询