Link to home
Start Free TrialLog in
Avatar of Crystalsoft
Crystalsoft

asked on

Label slowly moving right to left

Hello Experts
I want some animation in my form,  i did some coding also but not getting what i want,
stucked somewhere here.....

Private Sub Timer1_Timer()
    Call showprogress
End Sub
 
Private Sub showprogress()
On Error Resume Next
Dim intcounter As Integer
    Label1.Left = 2400
    For intcounter = 0 To Label1.Left
        Label1.Left = intcounter  ' Update progress.
    Next intcounter
End Sub

Open in new window

Avatar of Crystalsoft
Crystalsoft

ASKER

label is going right to left but very fast i want it slowly moving...How can i do that
Avatar of GrahamSkan
You aren't actually using the timer. Try this
Dim intCounter as Integer
Const Limit= 2400
 
Sub Command1_Click()
   intCounter = 0
   Timer1.Interval = 10
   Timer1.Enabled = True
End Sub
 
Private Sub Timer1_Timer()
    Call showprogress
End Sub
 
Private Sub showprogress()
   if intcounter < Limit then
      Label1.Left = intcounter 
   else
      Timer1.Enabled = False
   end if
End Sub

Open in new window

not working
actully i want that if lable.left = 2400 when once label moved with slowly than again from left to right moving. and i want it countinuesly,
another thing i want also to changing lable.Backcolor and forecolor also,
Thanks
ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

Thanks Buddy
It's working  :-)
Excellent