in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

Animate the needle like a speedometer

Last post 11/20/2008 8:52 PM by qiux sense. 3 replies.
Page 1 of 1 (4 items)
Sort Posts:
Previous Next
  • 11/13/2008 11:24 PM

    Animate the needle like a speedometer

    Hi, I can't move the needle within Timer.Tick event. If I set the initial value for the gauge control such as ArcScaleComponent3.Value = 30 And I want the needle is move up to 35 and move down back to 30 again, and it repeat itself. So it looks like animation, up down up down.. How I code that?

  • 11/14/2008 3:02 AM In reply to

    Re: Animate the needle like a speedometer

    Please take a look at this code snippet

      double time =0 , value =0.6, k = 1.3;
            private void Form1_Load(object sender, EventArgs e) {
                timer1.Start();
            }
            private void timer1_Tick(object sender, EventArgs e) {
                time++;
                arcScaleComponent1.Value += (float)((value - arcScaleComponent1.Value) * k + k / time * Math.Sin(time / 10));
            }

    Thanks, Roman

    R&D, .NET Team
    Developer Express Inc.

    PS. If you wish to receive direct assistance from our Support Team, use Support Center at http://www.devexpress.com/Support/Center
  • 11/18/2008 9:06 PM In reply to

    Re: Animate the needle like a speedometer

    Hi, Thanks for the reply.

    I still can't get it run.. I set the interval for the timer = 100..

    And could you help to explain what is time, value, and k?

    I copied and paste your code to C# windows form with a gauge and timer, but still can't move the needle.

    Please help... :)

  • 11/20/2008 8:52 PM In reply to

    Re: Animate the needle like a speedometer

    Hi, does anybody got idea about that?? :)

     

Page 1 of 1 (4 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED