08-17-2015 12:11 AM
Hi,
I am using MS 2013 with Vstudio 2010
I have a graph with 3 plots, and one cursor which in design time is attached to plot 0.
I need to reattach this cursor to plots 1 or 2, based on the index of my choise.
I guess one way would be to delete the existing gursor and re-create a new one, attached to a different plot.
But can it be done using already existing cursor? I could not find a way to do it .
I need something like:
private void comboBoxCursor_SelectedIndexChanged(object sender, EventArgs e)
{
var selected_plot = comboBoxCursor.SelectedIndex;
var cur_indx = waveformGraphScope.Cursors.IndexOf(xyCursorScope);
waveformGraphScope.Cursors. ????????.Plot[selected_plot ]
}
Thanks,
Igor
Solved! Go to Solution.
08-18-2015 10:23 AM
Igor,
You could definitely do the delete-and-recreate approach, but you may also be able to use some of the events associated with MS cursors--such as BeforeDraw() to--switch the draw functionality to a new graph.
Some of our custom cursor documentation can be found here: http://www.ni.com/example/10151/en/
08-18-2015 12:25 PM
Actually, it is simple:
if "selected_ch" is a plot number, then this will attach cursor to a particular plot:
waveformGraph.Cursors[0].Plot = waveformGraph.Plots[selected_ch];
Igor
08-19-2015 10:33 AM
Igor,
That's interesting; I'm glad you got that to work.