How to Enable Pan Tool for Diagram Area and Move Tool for Node
In the WF Diagram Control, you can enable the pan tool for the diagram area and the move tool for the node simultaneously by using the NodeMouseEnter and NodeMouseLeave events. We have provided a sample to achieve this requirement.
In this code snippet, we have enabled the SelectTool for the node region using the Node Enter event and PanTool for the diagram page area using the Node Leave event.
// Where diagram is the instance of the Diagram control.
this.diagram.EventSink.NodeMouseEnter += EventSink_NodeMouseEnter;
this.diagram.EventSink.NodeMouseLeave += EventSink_NodeMouseLeave;
private void EventSink_NodeMouseLeave(NodeMouseEventArgs evtArgs)
{
this.diagram.Controller.ActivateTool("PanTool");
}
private void EventSink_NodeMouseEnter(NodeMouseEventArgs evtArgs)
{
this.diagram.Controller.ActivateTool("SelectTool");
}
Conclusion:
I hope you enjoyed learning about How to enable pan tool for diagram area and move tool for node.
You can refer to our WinForms Diagram feature tour page to know about its other groundbreaking feature representations. You can also explore our WinForms Diagram documentation to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!