Hi Blanca,
Thanks for using Syncfusion Products.
Diagram control has support to customize its Tools by deriving the appropriate Tool class. We suggest you to create your own Custom Tool and override its CreateNode method to customize the node inorder to achieve your requirements.
We have customize the LineTool and RectangleTool to meet your requirements, please refer the below code snippet.
LineTool:
[C#]
class MyLineTool:LineTool
{
public MyLineTool(DiagramController controller): base(controller)
{
this.Name = "MyLineTool";
}
protected override Node CreateNode(PointF ptStart, PointF ptEnd)
{
LineBase toReturn = new Line(new PointF[] { ptStart, ptEnd });
toReturn.EditStyle.DefaultHandleEditMode = HandleEditMode.Vertex;
SetDecorator(toReturn);
//Setting EnableCentralPort to false by default
toReturn.EnableCentralPort = false;
return toReturn;
}
}
RectangleTool:
[C#]
class MyRectTool:RectangleTool
{
public MyRectTool(DiagramController controller)
: base(controller)
{
this.Name = "MyRectTool";
}
protected override Node CreateNode(RectangleF rectBounding)
{
Syncfusion.Windows.Forms.Diagram.Rectangle rect=new Syncfusion.Windows.Forms.Diagram.Rectangle(rectBounding);
//Drawing a rectangle without color by default
rect.FillStyle.Color = Color.Transparent;
return rect;
}
}
We have prepared a simple sample to demonstrate this and the same can be downloaded from the below link,
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=LineTool_RectangleToolDemo1968239555.zipPlease try the above sample and let me know if it helps.
Regards,
Bala Murugan A.S