Dim x As Long
Private Sub Form_Load()
Option1.Value = 1
HScroll1.Max = 500
HScroll1.Min = 0
HScroll1.SmallChange = 10
HScroll1.LargeChange = 50
Timer1.Interval = 100
Label1.Caption = "A"
End Sub
Private Sub HScroll1_Change()
Dim s As Integer
s = IIf(x = 0, 1, Sgn(x))
x = HScroll1.Value * s
End Sub
Private Sub Option1_Click()
x = Abs(x)
End Sub
Private Sub Option2_Click()
x = -x
End Sub
Private Sub Timer1_Timer()
Label1.Left = Label1.Left + x
If Label1.Left <= 0 Then x = Abs(x)
If Label1.Left + Label1.Width > Me.Width Then x = -x
End Sub