zoukankan      html  css  js  c++  java
  • zedgraph控件怎么取得鼠标位置的坐标值(转帖)

    我想取得zedgraph控件上任意鼠标位置的坐标值,IsShowCursorValues可以显示鼠标位置的值但是不能提取赋值给其他的变量。用PointValueEvent这个事件又只能得到已经画出的点的坐标,而我想得到任意位置的坐标。

    c.MouseDownEvent += new ZedGraphControl.ZedMouseEventHandler(myMouseDown);
            protected bool myMouseDown(object sender, MouseEventArgs e)
            {
                pDown.X = e.X;
                pDown.Y = e.Y;
                return true;
            }

    private void zedGraph1_MouseClick(object sender, MouseEventArgs e)
            {
                PointF mousePt = new PointF(e.X, e.Y);
                GraphPane pane = ((ZedGraphControl)sender).MasterPane.FindChartRect(mousePt);

                if (pane != null)
                {
                    double x, y;
                    pane.ReverseTransform(mousePt, out x, out y);
                    MessageBox.Show(x+""+y);
                }

            }

  • 相关阅读:
    git的版本回退
    elementui的表格有多选框时翻页记住之前选择的数据
    git操作总结
    POJ 3107 Godfather
    HDU 4405 Aeroplane chess
    ZOJ 3626 Treasure Hunt I
    UVA 10537 Toll! Revisited
    POJ 3093 Margaritas on the River Walk
    POJ 1655 Balancing Act
    POJ 2342 Anniversary party
  • 原文地址:https://www.cnblogs.com/xihong2014/p/4212528.html
Copyright © 2011-2022 走看看