使用滚动一个备忘录编辑也可以滚动另一个备忘录
我有两个相似的备忘录编辑(为了比较两个记录)我想保持滚动同步以方便比较。
我原本以为会有一个 OnScroll 事件,但没有看到一个,也没有看到任何类似的东西,我看到的最接近的是 Spin,这处理了一些可能性,但不是全部。
我也没有找到导航行的方法。
我确实看到了 ScrollToCaret 方法,但这并没有达到我想要的效果。
有什么想法吗?
I've got two memoedits which are similar (in order to compare two records) I would like to keep the scrolling in synch to ease comparison.
I had originally thought there would be an OnScroll event, but didn't see one, nor anything similar, the closest I saw was Spin, this handles some possibilities, but not all.
I also didn't see a way to navigate the rows.
I did see the ScrollToCaret method, but this doesn't do what I want.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这只能使用反射来实现。下面是显示如何同步垂直滚动条位置的代码:
如果您还想同步水平滚动条位置,您应该订阅 HScrollbar.ValueChanged 事件。除了最后一行之外,代码应该几乎相同:
This can be implemented using reflection only. Here is the code showing how to synchronize vertical scrollbar position:
If you want to also synchronize horizontal scrollbars position, you should subscribe to the HScrollbar.ValueChanged event. The code should be almost the same, except for the last line: