Results 1 to 4 of 4

Thread: How to effectively use a timer for animation?

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2012
    Posts
    12

    How to effectively use a timer for animation?

    Hello there.
    My question is how can i use a timer function to animate a form's width being smoothly expanded and contracted on the click of a button

    The resultant effect that i'm looking for is exactly what happens when you run windows native calculator

    1.Windows + R key. Run: "Calc"
    2. Change the views from View option between "Standard" and "Scientific".

    Any ideas?

    P.S - I've tried declaring two subs, using width += ## and width -= ##, but that doesnt output what i want, it just messes up things..
    Last edited by niksh19; Apr 24th, 2012 at 12:50 AM.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,302

    Re: How to effectively use a timer for animation?

    You apparently did it wrong because it works fine for me. As we haven't seen what you did, we can't say what you did wrong.

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2012
    Posts
    12

    Re: How to effectively use a timer for animation?

    I have encountered problems when i change the width += 1 to some other number like
    width += 10 or 15. Can you explain me why? As all i was trying to do is increase the speed of the animation, because the least that you can get on the timer is 1ms, which is surprisingly slow to increase / decrease the form's width.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,302

    Re: How to effectively use a timer for animation?

    You are again expecting us to divine information using ESP. How can I explain why you get problems when I don't know what problems you get? Try providing a FULL and CLEAR description of the problem that includes ALL the relevant information. Relevant code snippets and error messages are appropriate if they are available.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width