zedgraph EnableWheelZoom,缩放后如何获取轴值?
在我的 vb.net 项目中,我使用 zedgraph 来绘制图形。我发现以下属性可以很好地缩放鼠标中心的图形。
Friend WithEvents gcMain As ZedGraph.ZedGraphControl
Me.gcMain.IsZoomOnMouseCenter = True
Me.gcMain.IsEnableWheelZoom = True
我有两个工具条文本框来显示 x 轴的最小值和最大值。当我更改文本框中的值时,x 轴会发生变化。以下代码显示了处理文本框的示例。 但是,当使用 IsEnableWheelZoom 属性缩放图形时,我不知道如何更新文本框中的值。在 zedgraph 中,ZedGraphControl_MouseWheel 是受保护的事件。
Friend WithEvents tbxRangeStart As System.Windows.Forms.ToolStripTextBox
Private Sub tbxRangeStart_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles tbxRangeStart.KeyDown
Try
If e.KeyCode = Keys.Enter Then
' Change x Axis here
End If
Catch
End Try
End Sub
In my vb.net project, I use zedgraph to draw figures. I find that the following properties work well to zoom figure on the center of mouse.
Friend WithEvents gcMain As ZedGraph.ZedGraphControl
Me.gcMain.IsZoomOnMouseCenter = True
Me.gcMain.IsEnableWheelZoom = True
I have two toolstrip text boxes to show the minimum and maximum values of x axis. When I change values in text boxes, the x axis changes. The following code shows an example of handling the textbox. However I do not know how to update values in text boxes when the figure is zoomed by using IsEnableWheelZoom property. In zedgraph, ZedGraphControl_MouseWheel is a protected event.
Friend WithEvents tbxRangeStart As System.Windows.Forms.ToolStripTextBox
Private Sub tbxRangeStart_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles tbxRangeStart.KeyDown
Try
If e.KeyCode = Keys.Enter Then
' Change x Axis here
End If
Catch
End Try
End Sub
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 ZoomEvent:
Use the
ZoomEvent
:在vb.net中,使用以下代码
In vb.net, use following code