Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

right click an XyPointAnnotation to popup a menu

Solved!
Go to solution

Hi to all,

Does anyone know how to implement right-clicking an XyPointAnnotation to popup a menu? This is not one of the default events.

Thanks in advance,

CD

0 Kudos
Message 1 of 2
(2,849 Views)
Solution
Accepted by topic author cdouillet

Actually, I figured it out myself. For those interested, here is the VB.net code.

 

  Private Sub gr_PlotAreaMouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles gr.PlotAreaMouseDown
    Dim ann As NationalInstruments.UI.XYPointAnnotation = gr.GetAnnotationAt(e.X, e.Y)
    If Not IsNothing(ann) Then
      ContextMenuStrip1.Show(sender, e.X, e.Y)
    End If
  End Sub

 

Message 2 of 2
(2,848 Views)