コントロールを書きました。プログラムを実行すると、プログレスバーのテキストが点滅します。
     public class ProgressBarPercentage : ProgressBar
        {
            private int percent;//user defined step
            public void SetProgressBarText(string text)
            {
                using (Graphics gr = this.CreateGraphics())
                {
                    this.Refresh();
                    gr.DrawString(percent.ToString() + " %", SystemFonts.DefaultFont, Brushes.Black,
                        new PointF(this.Width / 2 - (gr.MeasureString(percent.ToString() + " %", SystemFonts.DefaultFont).Width / 2.0F),
                        this.Height / 2 - (gr.MeasureString(percent.ToString() + " %", SystemFonts.DefaultFont).Height / 2.0F)));
                }
            }
            public void SetPercent(int percent)
            {
                this.percent = percent;
                if (this.Value < 100)
                    this.Value = percent;
                else
                    this.Value = 99;
            }
        }
static void Main
{
            ProgressBarWindow.ProgressBarPercentage progress = new ProgressBarWindow.ProgressBarPercentage();
    for (int i = 0; i < 100; i++)
    {     
        progress.SetPercent(i);
        progress.SetProgressBarText(i.ToString());
    }
}   
私が何を間違えたのか教えてもらえますか?