做一个图片从左到右自动移动的程序,当图片移到窗体边框后自动改为从右到左移动
1个回答
展开全部
已经改了
Private Sub Form_Load()
Timer1.Enabled = True
Timer2.Enabled = False
Timer1.Interval = 10
Timer2.Interval = 10
End Sub
Private Sub Timer1_Timer()
Picture1.Left = Picture1.Left + 10
If Picture1.Left + Picture1.Height > Form1.Height - 500 Then
Timer2.Enabled = True
Timer1.Enabled = False
End If
End Sub
Private Sub Timer2_Timer()
Picture1.Left = Picture1.Left - 10
If Picture1.Left < 0 Then
Timer1.Enabled = True
Timer2.Enabled = False
End If
End Sub
Private Sub Form_Load()
Timer1.Enabled = True
Timer2.Enabled = False
Timer1.Interval = 10
Timer2.Interval = 10
End Sub
Private Sub Timer1_Timer()
Picture1.Left = Picture1.Left + 10
If Picture1.Left + Picture1.Height > Form1.Height - 500 Then
Timer2.Enabled = True
Timer1.Enabled = False
End If
End Sub
Private Sub Timer2_Timer()
Picture1.Left = Picture1.Left - 10
If Picture1.Left < 0 Then
Timer1.Enabled = True
Timer2.Enabled = False
End If
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询