Progress bar for a web browser control

前端 未结 3 903
别那么骄傲
别那么骄傲 2021-01-21 07:39

How can I put, and use, a progress bar for my web browser control, in a windows application project, using the c# language?

3条回答
  •  滥情空心
    2021-01-21 08:23

    Use WebBrowser.ProgressChanged Event, but to report the progress use the code below:

    private void WebBrowser1_ProgressChanged(Object sender, 
                                             WebBrowserProgressChangedEventArgs e)
    {
        progressBar.Maximum = (int) e.MaximumProgress;
        if (e.CurrentProgress > 0)
           progressBar.Value = (int) e.CurrentProgress;
    }
    

提交回复
热议问题