public void StopAnimation()
        {
            timer.Enabled = false;
            timer.Tick   -= timerMethod;
            running       = false;
            IAnimatedProgressPainter iapp = this.progresspainter as IAnimatedProgressPainter;

            if (iapp == null)
            {
                return;
            }
            iapp.Animating = false;
        }
        public void StartAnimation()
        {
            if (running)
            {
                return;
            }
            IAnimatedProgressPainter iapp = this.progresspainter as IAnimatedProgressPainter;

            if (iapp == null)
            {
                return;
            }
            iapp.Animating = true;
            running        = true;
            timerMethod    = new EventHandler(DoAnimation);
            timer.Interval = iapp.AnimationSpeed;
            timer.Tick    += timerMethod;
            timer.Enabled  = true;
        }
        private void DoAnimation(object sender, EventArgs e)
        {
            IAnimatedProgressPainter iapp = this.progresspainter as IAnimatedProgressPainter;

            if (iapp == null)
            {
                return;
            }

            //Rectangle newprog = base.borderbox;
            //newprog.Offset(this.borderpainter.BorderWidth, this.borderpainter.BorderWidth);
            //newprog.Size = new Size(newprog.Size.Width - this.borderpainter.BorderWidth, newprog.Size.Height - this.borderpainter.BorderWidth);
            ////int progWidth = (int)(((float)marqueePercentage * (float)backbox.Width) / 100f);
            //int progWidth = (int)(((float)marqueePercentage * (float)backbox.Width) / 100f);
            //newprog.Inflate(-base.ProgressPadding, -base.ProgressPadding);
            //newprog.Width = progWidth - (base.ProgressPadding * 2);

            //base.progressbox = newprog;

            ////iapp.AnimateFrame(newprog, g, ref marqueeX);

            this.Invalidate();
            this.Refresh();
        }