progressbar not displaying

  • Thread starter Thread starter Michaeld
  • Start date Start date
M

Michaeld

Hi,

I have a progress bar that is instantiated on form_load.
Created this simple button to test the progress bar but nothing moves or shows.
visible is true.... And I cannot see anything wrong...
See code below:

private void button1_Click(object sender, System.EventArgs e)
{
pgProgress.TabIndex = 0;
pgProgress .Maximum =15;
pgProgress .Minimum =1;
pgProgress .Step =1;
for(int i=pgProgress.Minimum; i <= pgProgress.Maximum; i++)
{
pgProgress.PerformStep();
this.Refresh();
}
}

Any help would be greatly appreciated.
 
Michaeld said:
Hi,

I have a progress bar that is instantiated on form_load.
Created this simple button to test the progress bar but nothing moves or shows.
visible is true.... And I cannot see anything wrong...
See code below:

private void button1_Click(object sender, System.EventArgs e)
{
pgProgress.TabIndex = 0;
pgProgress .Maximum =15;
pgProgress .Minimum =1;
pgProgress .Step =1;
for(int i=pgProgress.Minimum; i <= pgProgress.Maximum; i++)
{
pgProgress.PerformStep();
this.Refresh();
}
}

Any help would be greatly appreciated.

Try

pgProgress.Refresh();

or

pgProgress.Update();

instead.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top