LoadCompleted在WPF WebBrowser控件不触发 [英] LoadCompleted Not Firing in WPF WebBrowser Control

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

问题描述

我有我使用自动化网站一个简单的WPF WebBrowser控件。我想要加载的页面是一个ASP.NET页面。当我尝试正常浏览到它,LoadCompleted永远不会被解雇。如果我试图找到它,并读取与IHTMLElementCollection元素在导航的情况下,那么LoadCompleted事件不火。这是没有道理给我。不管LoadCompleted事件应该火,因为我加载在这两种情况下一个页面。

I have a simple WPF webBrowser control that I am using to automate a website. The page that I'm trying to load is an ASP.NET page. When I try to navigate to it normally, LoadCompleted is never fired. If I try to navigate to it, and read the elements with an IHTMLElementCollection in the Navigated event, then the LoadCompleted event does fire. It doesn't make sense to me. The LoadCompleted event should fire regardless, because I'm loading a page in both situations.

任何想法?

推荐答案

原来,这些事件能够正确工作的控制有可见。我一直在试图展现的一切处理后,终端的控制,但将无法工作。

It turns out for those events to work correctly the control has to be visible. I had been trying to show the control at the end after everything processed, but that will not work.

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

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