Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

ProgressBar percentage disappears when Loading

$
0
0
 

Why does my progressbar percentage text disapear when progressbar starts loading?? Am I missing out anything?

 int percent = (int)(((double)(progressBar1.Value - progressBar1.Minimum) / (double)(progressBar1.Maximum - progressBar1.Minimum)) * 100);

using (Graphics gr = progressBar1.CreateGraphics()){    gr.DrawString(percent.ToString() + "%",    SystemFonts.DefaultFont,    Brushes.Black,    new PointF(progressBar1.Width / 2 - (gr.MeasureString(percent.ToString() + "%", 

  SystemFonts.DefaultFont).Width / 2.0F),    progressBar1.Height / 2 - (gr.MeasureString(percent.ToString() + "%",    SystemFonts.DefaultFont).Height / 2.0F)));}





Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>