From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any easy way to move the cursor in a plot by just a mouse click?

Right now I have to click at the cursor and drag it to the right position. I was wondering if there is an easy way to just do the mouse click to change the cursor (not dragging the cursor). I have only one cursor in the graph.
0 Kudos
Message 1 of 5
(3,137 Views)
Assuming that if you click the cursor that you want it to always move to the same position, I think that you could do what you want by calling the cursor's SetPosition method in the graph's CursorMouseDown event.

- Elton
Message 2 of 5
(3,137 Views)
I tried to detect CursorMouseDown event but I can not detect it. I can detect just the MouseDown event when I click mouse anywhere on the graph. How to activate the CursorMouseDown event??
0 Kudos
Message 3 of 5
(3,137 Views)
To get plot and cursor events, your graph must be in track mode "Plot and Cursor Events". That is why you aren't getting the CursorMouseDown.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 4 of 5
(3,137 Views)
Try setting the TrackMode property to CNiGraph::TrackAllEvents.

- Elton
0 Kudos
Message 5 of 5
(3,137 Views)