09-17-2016 11:41 PM
Hi,
I am using MS 2013 with Vstudio 2010.
During dragging plot cursor by mouse, the current cursor positon is dynamically updated while it is moved.
However, the "scatterGraph.Cursors[0].XPosition" is only updated on event "AfterMove", when cursor is released.
I want to dynamycally change caption of the plot WHILE cursor is moved, like:
private void scatterGraph1_CursorChanged(object sender, EventArgs e) {
scatterGraph.Caption = "X=" + scatterGraph.Cursors[0].XPosition.ToString("#00.0") + ", Y=" + scatterGraph.Cursors[0].YPosition.ToString("0#.0");
}
During move, this even is fired, but Xposition Yposition do not change until mouse button is released.
I can see dynamic changes on a plot in the small box attached to cursor, however I cannot find a way to extract position of the cursor before mouse is released.
How I can do it?
Thanks, Igor
Solved! Go to Solution.
09-19-2016 03:11 PM
There is a BeforeMoveCursor event that you can use. Is it possible to call that and constantly update the position values? Here's the online documentation on it.
09-19-2016 04:29 PM
Thank you,
I made it working, but used AfterMoveCursor event:
private void scatterGraph_AfterMoveCursor(object sender, NationalInstruments.UI.AfterMoveXYCursorEventArgs e) {
var Xpos = e.Cursor.XPosition;
var Ypos = e.Cursor.YPosition;
scatterGraph.Caption = "X=" + Xpos.ToString("#00.0") + ", Y=" + Ypos.ToString("0#.0");
}
Igor