Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

xycursor position

Solved!
Go to solution

Hi,

 

I have created a cursor by using:

 

XYCursor cursor = new XYCursor()

 

and immediatelly after creation I want to set its default X-Position by using:

 

cursor.XPosition = 5;

 

but it is crashing saying : object reference not set to an instance of an object

 

any ideas?

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

Hi,

 

You need to assign the cursor to a plot and add it to the graph

 

 

XYCursor myCursor = new XYCursor(this.waveformPlot1);

waveformGraph1.Cursors.Add(myCursor);

myCursor.XPosition = 5;
myCursor.YPosition = 5;

 

Curt

 

Message 2 of 2
(4,884 Views)