使用 Zedgraph 重新映射鼠标控制?
我正在使用 ZedGraph,我想通过按住 Ctrl
并用鼠标左键拖动框来缩放到选定区域,而不是用鼠标中键单击并拖动。
默认行为是仅使用鼠标左键进行缩放并使用鼠标中键进行平移,但我已经切换了这两种操作。
有谁知道如何通过单击并拖动左键(不按住 Ctrl)来调用平移,以及如何通过按住 Ctrl
然后单击并拖动左键来调用缩放?
I am using ZedGraph and I want to zoom to a selected area by holding down Ctrl
and dragging the box with the left mouse button instead of clicking and dragging with the middle mouse button.
The default behavior is to zoom with just the left mouse button and to pan with the middle mouse button, but I have switched these two operations already.
Does anyone have any idea how to make panning be called by clicking and dragging with the left button (without holding down Ctrl) and zooming be called by holding down Ctrl
and then clicking and dragging with the left button?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ZedGraphControl 允许平移和缩放 通过控件的属性来控制缩放。 仅使用鼠标左键启用平移:
并使用 Ctrl+鼠标左键启用缩放:
设计器属性窗口似乎不想让您只指定修饰符键的控制,因此您必须将其放置在代码中 - 例如,表单的 Load 事件处理程序。
The ZedGraphControl allows Pan & Zoom to be controlled through properties of the control. To enable panning with just the left mouse button:
and to enable Zoom with Ctrl+Left mouse button:
The designer properties window doesn't seem to want to let you just specify Control for the Modifier Keys, so you'll have to put it in code - the Form's Load event handler, for example.
您是否通过代码尝试过:
zg.GraphPane.XAxis.Scale.Min = xxxx;
zg.GraphPane.XAxis.Scale.Max = yyyy;
//和
zgc.ScrollGrace = 0.1;
Have you try it by code using:
zg.GraphPane.XAxis.Scale.Min = xxxx;
zg.GraphPane.XAxis.Scale.Max = yyyy;
//and
zgc.ScrollGrace = 0.1;