I use the code to get my x,y value in the textbox1 when the mouse hovers over a point
but i also need to get when the mouse click a point in the textbox2, I need the value of x y point to calculate from point1 to point2 distance when the mouse click point1 to point2.
I don't know how to write the code ?
pls help me !!?
zg1.PointValueEvent += new ZedGraphControl.PointValueHandler( MyPointValueHandler );
private string MyPointValueHandler( ZedGraphControl control, GraphPane pane,
CurveItem curve, int iPt )
{
// Get the PointPair that is under the mouse
PointPair pt = curve[iPt];
textbox1.text=pt.Y.ToString() + pt.X.ToString();
return pt.Y.ToString() + pt.X.ToString();
}
Last edit: Cheng-Han,Yang 2018-03-20
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'd like to isplay value (X-axis & Y-axis) of a point in graph when moving mouse to this point ! how can i do this ? waiting for your help ! ^~^
On Mon, Dec 10, 2012 at 8:55 AM, Chanh Quang Nguyen nqchanh@users.sf.netwrote:
you have to use the pointvalue event of the zedgraph.
private string zedGraphControl1_PointValueEvent(ZedGraphControl sender, GraphPane pane, CurveItem curve, int iPt)
{
return "(" + curve.Label.Text + ") - (Sequence No. "+curve.Points[iPt].Tag.ToString()+") - Length:" + curve.Points[iPt].X.ToString() + ")-" + " (Elevation:" + curve.Points[iPt].Y.ToString() + ")";
}
Now when you move your mouse along the curve it will display the xy on the graph
Hi, pls help me to solve the problem
I use the code to get my x,y value in the textbox1 when the mouse hovers over a point
but i also need to get when the mouse click a point in the textbox2, I need the value of x y point to calculate from point1 to point2 distance when the mouse click point1 to point2.
I don't know how to write the code ?
pls help me !!?
zg1.PointValueEvent += new ZedGraphControl.PointValueHandler( MyPointValueHandler );
Last edit: Cheng-Han,Yang 2018-03-20
Double post. Please don't do that.
sorry..i don't know how to delete it ><