OK, here is my code for what to paint on the progressbar:
private void timer2_Tick(object sender, EventArgs e)
{
int percent = progressBar1.Value;
progressBar1.CreateGraphics().DrawString(percent.ToString() + "%", new Font("Arial", (float)8.25, FontStyle.Regular), Brushes.Black, new PointF(progressBar1.Width / 2 - 10, progressBar1.Height / 2 - 7));
progressBar1.Increment(+1);
if (progressBar1.Value >= 99)
{
timer2.Stop();
this.Close();
}
Ok, so i am painting a label in the middle of it that will display the progressbar’s value. For some reason, it keeps blinking….disappearing and reappearing. So, someone told me to take out that code and put it in the paint method…..i do not see it. Is there an easier way?
Here’s a code that should work (I went with option number 3, creating a child Class and overriding the WndProc to handle the paint message: