Step() public static method

public static Step ( float from_value, float to_value, float speed ) : float
from_value float
to_value float
speed float
return float
        private void ApplicationOnUpdateEvent()
        {
            if (updatePos == false && Style != ProgressBarStyle.Marquee)
            {
                return;
            }

            if (Style == ProgressBarStyle.Marquee)
            {
                barWidth = marqueeWidth;
                if (barX < Width)
                {
                    barX = MathHelper.Step(barX, Width, marqueeSpeed / 2f);
                }
                else
                {
                    barX = -marqueeWidth;
                }
                return;
            }

            barX      = 0;
            barWidth  = (value / (float)maximum) * Width;
            updatePos = false;
        }
Beispiel #2
0
            protected override void OnPaint(PaintEventArgs e)
            {
                base.OnPaint(e);

                if (currentY < 0)
                {
                    currentY         = MathHelper.Step(currentY, 0, 240);
                    listBox.Location = new Point(0, (int)currentY);
                }
            }