自动滚动所有边
我有一个自动滚动设置为 true 的面板。在此面板中,我有一个代表绘图画布的图形控件。放大画布意味着图形控件的尺寸会增加,并最终超过包含的控件。
我的问题是,将物体移动到负坐标时没有自动滚动。我想让我的图形控件在所有侧面都增长并保持其中心在视图中,并获得允许向左/向右和向上/向下滚动的滚动条。据我所知,我只会向下和向右滚动。
I have a panel with autoscroll set to true. In this panel I have a graphical control representing a drawing canvas. Zooming in to the canvas means that the graphical control increases in size and eventually exceeding the containng control.
My problem is that there is no autoscroll when moving things to negative coordinates. I would like to have my graphical control to grow on all sides and keep its center in view and get scrollbars that allow scrolling both left/right and up/down. As far as I can see I will only get scrolling down and right.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您只需相应地调整面板的
AutoScrollPosition
即可。要将位置设置为图形控件的中间(无论是什么),请在面板上尝试以下操作:
You just have to adjust the panel's
AutoScrollPosition
accordingly.To set the position to the middle of your graphical control (whatever that is), try this on your panel: