问题描述
有没有人成功地将鼠标滚动事件捕获到网络浏览器组件中?
Has any one successfully trapped the event of mouse scroll in a web browerser component?
我想同时滚动两个网络浏览器控件.
I have two web browser controls i would like to scroll at the same time.
但是网络浏览器没有滚动事件.
But there are no scroll events for web browsers.
我想在下面创建一个类似这样的活动?有人做过或见过吗?
在这里我会调用我的事件并继续执行代码.
Here i would call my event and proceed with the code.
我找到了这段代码,但不知道如何使用它.这是一个事件.
I have found this code but don't know how to use it. its an event.
推荐答案
我能够让这个工作如下.此示例假定两个 Web 浏览器控件都导航到同一个 Url.除了垂直滚动条之外,我还同步水平滚动条 - 如果不需要,可以省略.
I was able to get this working as follows. This example assumes that both web browser controls are navigating to the same Url. I am also syncing the horizontal scrollbar in addition to the vertical - this can be omitted if it is not required.
我注意到您在 中的评论.NET中如何获取webbrowser控件的滚动条位置,与此操作相关
I note your comment in How to retrieve the scrollbar position of the webbrowser control in .NET, relating to this operation
不工作.我可以确认这绝对适用于我的机器,因此如果此代码在您的机器上不起作用,我可以寻找替代方案.
not working. I can confirm that this definitely works on my machine, so if this code does not work on yours I can look into alternatives.
这篇关于为 Web 浏览器控件创建 OnScroll 事件处理程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!