支持鼠标平移和缩放的 Windows.Forms 控件的建议
我在 http:// 找到使用 Autoscroll 属性自定义面板 www.codeproject.com/KB/miscctrl/CustomAutoScrollPanel.aspx 是一个带有 AutoScroll = True
的 Panel
包装器。
我喜欢这个控件,因为它提供了“performScrollHorizontal”和“performScrollVertical”方法。然而,它使用 Windows API 函数而不是 ScrollableControl
及其 VerticalScroll
和 HorizontalScroll
属性。
这是一个很好用的控件吗?我认为应该使用 ScrollableControl 而不是 Windows API。你怎么认为?有没有更好的控制方法?我还需要一个控件吗?我认为 ScrollableControl 提供了我需要的一切。
编辑:我找到了 HScrollBar 和 VScrollBar 控件。我应该使用它们吗?
这两个其他控件很好,但没有给我提供像上面的控件那样控制滚动条的方法。
- 可滚动、可缩放和可伸缩的图片框 http://www.codeproject.com/KB/miscctrl/ScalablePictureBox.aspx
- 平移和缩放非常大的图像 http://www.codeproject.com/KB/GDI-plus/PanZoomExample。 aspx
我真正想要的是一个控件:
- 当用户将鼠标移向控件边缘时滚动,
- 允许用户平移
- 允许用户缩放
- 支持使用鼠标并按下 Shift 或 Ctrl 或 Alt 键
任何建议、帮助或需要关注的领域都将不胜感激。一个控制会很好,因为我还没有那么好。
I found Customize a panel with Autoscroll property at http://www.codeproject.com/KB/miscctrl/CustomAutoScrollPanel.aspx that is wrapper around a Panel
with AutoScroll = True
.
I like this control because it provides the "performScrollHorizontal" and "performScrollVertical" methods. Yet, it uses the Windows API functions instead of ScrollableControl
and its VerticalScroll
and HorizontalScroll
properties.
Is this a good control to use? I think it should be using ScrollableControl
instead of the Windows API. What do you think? Is there a better control available? Do I even need a control? I would think that ScrollableControl
provides everything I would need.
EDIT: I found the HScrollBar and VScrollBar controls. Should I be using them?
These two other controls are nice but do not give me a way to control the scroll bars like the above control does.
- A scrollable, zoomable, and scalable picture box at
http://www.codeproject.com/KB/miscctrl/ScalablePictureBox.aspx - Pan and Zoom Very Large Images at
http://www.codeproject.com/KB/GDI-plus/PanZoomExample.aspx
What I really want is a control:
- that scrolls when the user moves the mouse toward the edge of the control,
- allows the user to pan
- allows the user to zoom
- supports using the mouse with Shift or Ctrl or Alt keys pressed
Any recommendations, help, or areas to look at is greatly appreciated. A control would be nice as I am not that good yet.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一些可以玩的代码。它支持焦点、平移和滚动。缩放是一项工作,我的笔记本电脑的鼠标垫妨碍了测试。使用定时器实现边缘自动滚动。
Some code to play with. It supports focus, panning and scrolling. Zooming is work-to-do, my laptop's mousepad got in the way of testing it. Use a timer to implement auto-scrolling at the edges.