vb中用timer控件,实现label标签在窗体之间左右移动,谢谢 5
展开全部
Dim a As Boolean
Private Sub Form_Load()
a = True
Timer1.Interval = 100
End Sub
Private Sub Timer1_Timer()
If Label1.Left < 100 Then a = True
If Label1.Left > 2000 Then a = False
If a = True Then Label1.Left = Label1.Left + 100
If a = False Then Label1.Left = Label1.Left - 100
End Sub
Private Sub Form_Load()
a = True
Timer1.Interval = 100
End Sub
Private Sub Timer1_Timer()
If Label1.Left < 100 Then a = True
If Label1.Left > 2000 Then a = False
If a = True Then Label1.Left = Label1.Left + 100
If a = False Then Label1.Left = Label1.Left - 100
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询