如何捕获WPF形式的网页(在WebBrowser控件中打开)的按钮单击事件?
考虑一个场景,我在 WPF 应用程序中有一个 WebBrowser 控件。 网页在 WebBrowser 控件内加载。该网页包含一个按钮。 该网页是 ASP.NET 应用程序。
我想将网页的按钮单击事件捕获到 WPF 表单(托管 WebBrowser 控件)中。有什么办法可以实现这个功能吗?
Consider a scenario where I have a WebBrowser Control in WPF application.
A web page is loaded inside WebBrowser Control. The web page contains a button.
The web page is of ASP.NET application.
I want to capture the button click event of the webpage into WPF Form (which hosts WebBrowser Control). Is there any way to achieve this functionality?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
下面的代码应该完全按照您想要的方式进行操作,并带有注释来解释正在发生的事情:
其中一些内容取自 http://beensoft.blogspot.com/2010/03/two-way-interaction-with-javascript-in.html
Here is code that should do exactly what you want with comments to explain what is going on:
Some of this was taken from http://beensoft.blogspot.com/2010/03/two-way-interaction-with-javascript-in.html