We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to cancel a diagram event?

Platform: WinForms |
Control: Diagram

The following events under diagram.model.eventsink has an option to cancel.

List of cancellable events


The NodeCollectionChanged event is raised when the node collection contained in the model is changed (added/removed).


The NodeCollectionChanging event is raised while modifying the model’s node collection.


This ConnectionsChanged event is raised when the connections between the nodes are modified.


The ConnectionsChanging event is raised while modifying connections between the nodes.


The LabelsChanged event is raised when labels are added.


The PropertyChanging event is raised while modifying the model’s property.


The FlipChanging event is raised while the node is inverted using Flip property.


The PinOffsetChanging event is raised while modifying the offset of the pinpoint.


The PinPointChanging event is raised while changing the node’s pinpoint.


The PortsChanged event is raised when the ports are added or changed.


The RotationChanging event is raised when the node is rotating.


The SizeChanging event is raised when the size of the node or connector is modified.


The VertexChanging event is raised when the vertex of the node is changed.


The ZorderChanging event is raised when Zorder of the node is changed. When the node order is changed from front-to-back or from back-to-front, the ZorderChanging event is raised.

The following code example is used to cancel the events.


diagram1.Model.EventSink.NodeCollectionChanged += EventSink_NodeCollectionChanged;
void EventSink_NodeCollectionChanged(CollectionExEventArgs evtArgs)
     if (evtArgs.ChangeType == CollectionExChangeType.Remove)
     //Events can be cancelled by setting the cancel property as true
            evtArgs.Cancel = true;


Private diagram1.Model.EventSink.NodeCollectionChanged += AddressOf EventSink_NodeCollectionChanged
Private Sub EventSink_NodeCollectionChanged(ByVal evtArgs As CollectionExEventArgs)
  If evtArgs.ChangeType = CollectionExChangeType.Remove Then
  'Events can be cancelled by setting the cancel property as true
   evtArgs.Cancel = True
  End If
End Sub


2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile