T
Tom
I have a progressbar that I'm creating text on. I'm doing so via the
following inside a function:
graphics = progressBar1.CreateGraphics();
progressBar1.Refresh();
graphics.DrawSTring(
theString,
SystemFonts.DefaultFont,
Brushes.Black,
new PointF(progressbar1.Location.X, progressbar1.Location.Y));
I invoke this function from a background worker thread every second. My
doWork function in my background worker thread is basically the following:
while(true)
{
invokeTheFunctionToUpdateTheProgressBarTextInTheMainGUIThread();
Thread.Sleep(1000);
}
My problem is while the progress bar creates the text over it, the text
seems to disappear and reappear every second. I'm guessing it has something
to do with that Thread.Sleep, but does anybody know how I can update my
progress bar text without having the text seem to flicker?
Thanks.
following inside a function:
graphics = progressBar1.CreateGraphics();
progressBar1.Refresh();
graphics.DrawSTring(
theString,
SystemFonts.DefaultFont,
Brushes.Black,
new PointF(progressbar1.Location.X, progressbar1.Location.Y));
I invoke this function from a background worker thread every second. My
doWork function in my background worker thread is basically the following:
while(true)
{
invokeTheFunctionToUpdateTheProgressBarTextInTheMainGUIThread();
Thread.Sleep(1000);
}
My problem is while the progress bar creates the text over it, the text
seems to disappear and reappear every second. I'm guessing it has something
to do with that Thread.Sleep, but does anybody know how I can update my
progress bar text without having the text seem to flicker?
Thanks.