How to use a BackgroundWorker?

How can I use backgroundworker in my browser?

  • I'm trying to create my own web browser for my practice on windows application. So I've make a windows form for web browser. Now I want to use backgroundworker or progressbar to show real process of page loading but I don't know how to do it. I tried with Google but no result for me. So please help me if my question is right to ask about it.

  • Answer:

    // add progress bar private ProgressBar progressBar1; //create event for ProgressChanged Browser.ProgressChanged += Browser_ProgressChanged; ... // set progress bar value when ProgressChanged event firing void Browser_ProgressChanged(object sender, WebBrowserProgressChangedEventArgs e) { if (e.MaximumProgress > 0) { int prog = (int)(100 * e.CurrentProgress / e.MaximumProgress); progressBar1.Value = prog; } } http://hashfactor.wordpress.com/2009/03/31/c-winforms-using-a-progress-bar-with-web-browser-control/

avirk at Stack Overflow Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.