Marker moved by Cursor not working
Posted: Wed Aug 12, 2020 7:35 am
Hi All :
I have a piece of code that is not running properly despite it's a very simple task.
Would you please help me to force the marker to be on in the right place after I move the red crossaim marker?
After I move the marker, I call "SolveNearestSampleByCoord" to get the nearest sample : the values are correct. as you can see in the textboxes.
but the cursor stays in the mouse location instead of going to the desired place.
This is the simple code i'm using.
I have a piece of code that is not running properly despite it's a very simple task.
Would you please help me to force the marker to be on in the right place after I move the red crossaim marker?
After I move the marker, I call "SolveNearestSampleByCoord" to get the nearest sample : the values are correct. as you can see in the textboxes.
but the cursor stays in the mouse location instead of going to the desired place.
This is the simple code i'm using.
Code: Select all
private void Cl1_MovedByMouse(object sender, MouseEventArgs e)
{
SeriesEventMarker marker = (SeriesEventMarker)sender;
selectedCursor = marker.Tag.ToString();
cursorSelected = true;
double dXValue, dYValue;
int iNearestIndex;
int a = 0;
m_chart.BeginUpdate();
if (m_chart.ViewXY.SampleDataSeries[0].SolveNearestSampleByCoord(e.X, e.Y, out dXValue, out dYValue, out iNearestIndex)) ;
{
marker.VerticalPosition = SeriesEventMarkerVerticalPosition.AtYValue;
marker.HorizontalPosition = SeriesEventMarkerHorizontalPosition.AtXValue;
marker.Symbol.Shape = Shape.CrossAim;
marker.XValue = dXValue;
marker.YValue = dYValue;
XXX = dXValue;
YYY = dYValue;
txtX.Text = XXX.ToString(); // Just to make sure it is the right values
txtY.Text = YYY.ToString();
}
m_chart.EndUpdate(); ;
}