2

Hopefully someone can help.

I've created a user control which hosts a Web Browser control I've added this control to my new project. When I start the application and view the control the web site is loaded correctly and the LoadCompleted Event fires ok.

However I actually initialize the control from another class and ask it to navigate to the page in the background (I invoke the UI Thread), I see the navigate method get called but the LoadCompleted Event never fires until you view the form which the Web Control is hosted on.

It seems that the Web Browswer control is only rendered when the form is viewed. I need the Broswer to fully load the page because I'm invoking JavaScript functions which need to be ready for when the user looks at the form containing the web page.

Is there any way to force the browser to render the content without actually showing the page?

Thanks

2
  • You could use the WinForms version of WebBrowser control which doesn't exhibits such behavior and doesn't even require a parent window to operate.
    – noseratio
    Oct 1, 2013 at 2:52
  • 2
    @Noseratio, Thanks I've hosted the WinForms WebBroser and its working fine now. I've also got more control over the component which is a bonus. Oct 1, 2013 at 14:06

1 Answer 1

1

Hosted WinForms Web Browser as suggested by Noseratio.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.