Tony

Tony

  • NA
  • 1
  • 0

Progressbar not showing

Jun 18 2009 10:25 AM
Hi All!

Whilst I'm not a complete newbie to C#, I'm also not an expert, so here goes...

I've have a child form (not sure that's important here, but it might be good to mention) which has a button. When the button is clicked, the event handler method is called, obviously!

But here is where my problem starts. The first thing that the method does is to create a new progressbar, after which the rest of the code does its thing (which in this case is a web page scraper - quite complicated and lengthy, hence the progressbar).

However, the progressbar never shows, even though the rest of the code completes successfully.

Please, please can someone help me, because it's frutrating the hell out of me.

Here's the relevant code:

private void btnGetPage_Click(object sender, EventArgs e)
{
try
{
ProgressBar pbProgressBar = new ProgressBar();
pbProgressBar.Style = ProgressBarStyle.Continuous;
pbProgressBar.Visible = true;
pbProgressBar.Show();

.... rest of the code
} etc, etc

Many thanks in advance for any suggestions and help.

Cheers,
Tony

Answers (2)