Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Annotation Mouse Event

Solved!
Go to solution

I want to allow the user to right click on an annotation caption and pop up a menu that allows them to edit the text or delete the annotation. Obviously there is code somewhere that detects when my mouse is over the annotation caption because it changes my cursor to indicate I can move the text around. Am I able to do a similar thing to indicate when I right click on the caption text?

0 Kudos
Message 1 of 3
(4,896 Views)

VHalbur,

It appears that there is not an event that can be captured for a right-click or even a general mouse down event on a caption.


As an alternative, you could provide an edit button on the form that pops up a dialog allowing them to change any caption. You can retrieve the list of annotations using the waveformGraph.Annotations property of the graph. You can both get/set the text of each annotation programatically using this method.


Also, you can capture the right-click event of the entire graph, but there is not a way to ensure that this event is only fired when an annotation is right-clicked.

Jared A.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(4,888 Views)
Solution
Accepted by topic author VHalbur

When the mouse is over an annotation caption, the cursor changes to SizeAll. So I captured a right-click event on the graph and display the menu if the cursor is SizeAll. Otherwise I ignore it. Thanks for your reply.

0 Kudos
Message 3 of 3
(4,886 Views)