vb怎样使字条从左到右反复循环

来源:百度知道 编辑:UC知道 时间:2024/06/07 23:45:35
vb怎样使字条从左到右反复循环
Private Sub Timer1_Timer()
Static i As Integer
i = i + 1
If Label1.Left <= 1 Then
Label1.Left = Form5.Width

End If
Label1.Left = Form5.Width - i * 100

End Sub
我这个编码只能使label从左到右走一次然后就显示“溢出”
那位大侠能告诉我怎样写才能使label从左到右反复循环走动?

使字条从右到左反复循环:
Private Sub Timer1_Timer()
Static i As Integer
i = i + 1
If Label1.Left > 0 Then
Label1.Left = Me.Width - i * 100
ElseIf Label1.Left <= 0 Then
i = 0
Label1.Left = Me.Width
End If
End Sub
使字条从左到右反复循环
Private Sub Timer1_Timer()
Static i As Integer
i = i + 1
If Label1.Left < Me.Width Then
Label1.Left = i * 100
ElseIf Label1.Left >= Me.Width Then
i = 0
Label1.Left = 0
End If
End Sub
左右来回代码
Private Sub Form_Load()
Timer1.Interval = 50
Timer2.Interval = 50
Timer1.Enabled = True
Timer2.Enabled = False
End Sub
Private Sub Timer1_Timer()
Static i As Integer
i = i + 1
If Label1.Left > 0 Then
Label1.Left = Me.Width - i * 100
ElseIf Label1.Left <= 0 Then
i = 0
Timer2.Enabled = True
Timer1.Enabled = False
End If
End Sub
Private Sub Timer2_Timer()
Static i As Integ