Override the double click event on a shape

Applies to: Nevron Diagram for .NET

How to override the double click event on a shape?

To override the double click event and use your own logic, you should do two things:

1. Set inplace edit protection of the shapes you want:

[C#]
NAbilities protection = shape.Protection;
protection.InplaceEdit = true;
shape.Protection = protection;

[VB.NET]
Dim protection As NAbilities = shape.Protection
protection.InplaceEdit = True
shape.Protection = protection

2. Subscribe to the NodeDoubleClick event of the drawing document's event sync service and in the event handler use the following code:

[C#]
private void EventSinkService_NodeDoubleClick(NNodeViewEventArgs args)
{
      NShape shape = args.Node as NShape;
      if (shape != null)
      {
            // Implement your logic here
            // ...
  
            // Mark the event as handled
            args.Handled = true;
      }
}

[VB.NET]
Private Sub EventSinkService_NodeDoubleClick(args As NNodeViewEventArgs)
    Dim shape As NShape = TryCast(args.Node, NShape)
    If shape IsNot Nothing Then
        ' Implement your logic here
        ' ...
  
        ' Mark the event as handled
        args.Handled = True
    End If
End Sub

Article ID: 78, Created On: 10/7/2010, Modified: 11/15/2010