简体   繁体   English

Winforms中WebBrowser控件的已加载事件

[英]Loaded event for WebBrowser control in winforms

I need to access the below property of WebBrowser control when it is loaded completely. 完全加载后,我需要访问WebBrowser控件的以下属性。

webBrowser1.ActiveXInstance

this is null if the control is not loaded completely. 如果控件未完全加载,则为null。

What property/event can I check like Form_Load ? 我可以像Form_Load一样检查哪些属性/事件?

There is WebBrowser.LoadComplete event for top-level only (the WebBrowser here I guess). 仅在顶级存在WebBrowser.LoadComplete事件(我猜这里是WebBrowser)。 If you're looking for an non top-level element, DocumentCompleted event occurs for all elements. 如果要查找非顶级元素,则所有元素都会发生DocumentCompleted事件。

As ActiveXInstance is inherited from WebBrowserBase, there is also the Control.HandleCreated event, being fired when the control is displayed for the first time, though I don't know if it is applicable here. 由于ActiveXInstance是从WebBrowserBase继承的,因此还有Control.HandleCreated事件,该事件在第一次显示该控件时被触发,尽管我不知道它是否适用于此。

(Sadly I'm not able to give the class and event links, but should be possible to find them yourself, right?) (很遗憾,我无法提供课程和事件链接,但应该可以自己找到它们,对吧?)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM