开发者

How to stop a WPF WebBrowser from loading the page?

开发者_如何学Go

I see methods for GoBack, GoForward, Refresh, and Navigate, but no "Stop" or "Cancel". How do I do it?


Use can use the InvokeScript method over WebBrowser control to stop page navigation.

yourWebBrowser.InvokeScript("eval", "document.execCommand('Stop');");


Looks like it is a bit tricky you should get IWebBrowser2 interface from the WPF WebBrowser control, after that you may get access to some methods that not publicly exposed in this control.

More details here http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser(v=vs.90).aspx (Getting to the native IWebBrowser2)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜