LoadCompleted Not Firing in WPF WebBrowser Control

做~自己de王妃 提交于 2019-12-20 03:56:15

问题


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.

Any ideas?


回答1:


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.



来源:https://stackoverflow.com/questions/10585565/loadcompleted-not-firing-in-wpf-webbrowser-control

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!