Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebBrowser Control causes whole application to become unresponsive

Tags:

browser

c#

I have a C# .NET 3.5 application with an embedded web browser. The browser is designed to point to remote sites (Rather than anything local). Everything works fine, but when the page is slow to respond this causes my entire application to become unresponsive until the page is loaded.

I don't mind the browser being unresponsive while it does its thing, but the application going too is far from ideal.

Is there a good way to prevent this? Would it be beneficial to run the WebBrowser on a seperate thread - that's a bit beyond my skillset right now and I don't think the WebBrowser control really likes multithreading? But I can learn if needs be.

like image 981
Dan Avatar asked Nov 04 '22 22:11

Dan


1 Answers

See the answer #2 on this question for a solution on how to run it on a separate thread: BackgroundWorker and WebBrowser Control

You might as well read answer #1 too, it explain the behaviors you are seeing (WebBrowser control blocking UI thead).

like image 50
Jf Beaulac Avatar answered Nov 10 '22 15:11

Jf Beaulac