Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Binding cursor to plot is not working

Solved!
Go to solution

Hi,

 

I have two cursors which are associated to the same plot. In a certain moment, I need to associate those two cursors to another plot (plot is the same for both) so I do the following:

 

foreach (XYCursor cursor in MyScatterPlot.cursors)

{

      cursor.Plot = newPlot;

}

 

So, the problem is that first cursor in the iteration is not updated with the new plot but the second cursor is updated correctly with the new plot... so I do not understand why the first cursor is not updated..... any ideas?

 

If it try the following:

MyScatterPlot.cursors[0].Plot = newPlot;

MyScatterPlot.cursors[1].Plot = newPlot;

 

The behaviour is the same: first cursor is not updated with the new plot but second cursor is updated correctly with the new plot.

 

I'll highly appreciate if anybody can help me.

 

Thx.

 

 

0 Kudos
Message 1 of 2
(4,963 Views)
Solution
Accepted by topic author tonitpp

The problem was:

Once the plot property for first cursor was modified, at another point of my code this property was being modified later.

Sorry.


@tonitpp wrote:

Hi,

 

I have two cursors which are associated to the same plot. In a certain moment, I need to associate those two cursors to another plot (plot is the same for both) so I do the following:

 

foreach (XYCursor cursor in MyScatterPlot.cursors)

{

      cursor.Plot = newPlot;

}

 

So, the problem is that first cursor in the iteration is not updated with the new plot but the second cursor is updated correctly with the new plot... so I do not understand why the first cursor is not updated..... any ideas?

 

If it try the following:

MyScatterPlot.cursors[0].Plot = newPlot;

MyScatterPlot.cursors[1].Plot = newPlot;

 

The behaviour is the same: first cursor is not updated with the new plot but second cursor is updated correctly with the new plot.

 

I'll highly appreciate if anybody can help me.

 

Thx.

 

 




0 Kudos
Message 2 of 2
(4,923 Views)