Private Sub Timer1_Timer()
If i = 0 Then
If z.Left < 5000 Then
z.Left = z.Left + 100
Else
i = 2
End If
End If
If i = 2 Then
If z.Left > 0 Then
z.Left = z.Left - 100
Else
i = 3
End If
End If
If i = 3 Then
i = 0
End If
End Sub思想,当这个文字的左边距离大于窗体时,则应向回滚动,当左边距离为0时,应向右滚动。帮我一下
If i = 0 Then
If z.Left < 5000 Then
z.Left = z.Left + 100
Else
i = 2
End If
End If
If i = 2 Then
If z.Left > 0 Then
z.Left = z.Left - 100
Else
i = 3
End If
End If
If i = 3 Then
i = 0
End If
End Sub思想,当这个文字的左边距离大于窗体时,则应向回滚动,当左边距离为0时,应向右滚动。帮我一下
Dim i As Integer'Private Sub Form_Load()
' i = 0
'End SubPrivate Sub Timer1_Timer()If i = 0 Then
If z.Left + z.Width <= Form1.Width Then
z.Left = z.Left + 100
Else
i = 2
End If
End If
If i = 2 Then
If z.Left > 0 Then
z.Move z.Left - 100, z.Top
z.Left = z.Left - 100
Else
i = 0
End If
End If
‘Debug.Print i
’Debug.Print z.Left
End Sub
Dim i As Integer'Private Sub Form_Load()
' i = 0
'End SubPrivate Sub Timer1_Timer()If i = 0 Then
If z.Left <= Form1.Width Then
z.Left = z.Left + 100
Else
i = 2
End If
End If
If i = 2 Then
If z.Left > 0 Then
z.Move z.Left - 100, z.Top
z.Left = z.Left - 100
Else
i = 0
End If
End If
‘Debug.Print i
’Debug.Print z.Left
End Sub
你再试一试