Web浏览器控件LoadCompleted事件不触发 [英] Web Browser Control LoadCompleted Event Not Firing

查看:485
本文介绍了Web浏览器控件LoadCompleted事件不触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

希望有人可以提供帮助。

Hopefully someone can help.

我创建它承载我已经添加了这种控制我的新项目中的Web浏览器控件的用户控件。当我启动应用程序并查看该控件的网站是正确加载,并且LoadCompleted事件触发确定。

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.

不过,我确实初始化从另一个类的控制,并要求导航到后台的页面(我调用UI线程),我看到了导航方法被调用但LoadCompleted事件永远不会触发直到您看到该网页控制托管的表单。

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.

似乎形式查看时,网页Browswer控制仅呈现。我需要Broswer因为我援引了需要准备好当用户看包含网页表单的JavaScript函数完全加载页面。

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?

感谢

推荐答案

托管的WinForms Web浏览器通过Noseratio建议。

Hosted WinForms Web Browser as suggested by Noseratio.

这篇关于Web浏览器控件LoadCompleted事件不触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆