3个回答
展开全部
Dim m As Boolean '滚动方向
Private Sub Command1_Click()
m = Not m '改变方向
End Sub
Private Sub Form_Load()
Label1.AutoSize = True
Timer1.Interval = 100
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Dim s
s = 100 '滚动速度,越大越快
If m Then s = -s
Label1.Left = Label1.Left + s
If Label1.Left < -Label1.Width Then Label1.Left = Me.ScaleWidth '超出左边框
If Label1.Left > Me.ScaleWidth Then Label1.Left = -Label1.Width '超出右边框
End Sub
Private Sub Command1_Click()
m = Not m '改变方向
End Sub
Private Sub Form_Load()
Label1.AutoSize = True
Timer1.Interval = 100
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Dim s
s = 100 '滚动速度,越大越快
If m Then s = -s
Label1.Left = Label1.Left + s
If Label1.Left < -Label1.Width Then Label1.Left = Me.ScaleWidth '超出左边框
If Label1.Left > Me.ScaleWidth Then Label1.Left = -Label1.Width '超出右边框
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询