不需要的自动滚动到表单的开头
我有一个窗体,其中包含一个控件:面板,它比窗体本身大得多。因此,表单的滚动条用于导航该面板。表单的 Autoscroll
属性设置为 true
。问题是:显示任何对话框窗口后,AutoscrollPosition
设置为开始。我如何覆盖此行为以保存滚动位置。
I have a Form which contains one control: Panel, which is much bigger than form itself. So, the form's scrollbar is used to navigate this panel. Autoscroll
property of the form is set to true
. The problem is: after showing any dialog window the AutoscrollPosition
is set to begining. How I can override this behavior to save scroll position.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过在代码中手动设置滚动位置来覆盖它。只需使用表单的激活和停用事件。
在此处查找同一问题的答案和代码
https://stackoverflow.com/questions/2020938/why-does-scrolling-position-change-after-refocusing-the-form/2022561#2022561
You can override this by manually setting the scroll pos in your code. Just use Activated and Deactivated events of the form.
Look here for the answer to same problem and the Code
https://stackoverflow.com/questions/2020938/why-does-scrolling-position-change-after-refocusing-the-form/2022561#2022561