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.
Unfortunately, activation email could not send to your email. Please try again.

EnabledCentralPort to false by default

Thread ID:

Created:

Updated:

Platform:

Replies:

97708 Dec 29,2010 06:48 AM Jan 4,2011 03:40 AM Windows Forms 3
loading
Tags: Diagram
Blanca Calderon
Asked On December 29, 2010 06:48 AM

Hi,

is it possible by default, when you select LineTool, that the property EnabledCentralPort will ALWAYS be false?

Another question, I want the RectangleTool, always by default, draw a rectangle without color. It is a problem for me that the FillStyle in rectangle is yellow by default.

Thanks in advance for your help.


Bala Murugan A.S [Syncfusion]
Replied On December 30, 2010 03:55 AM

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.zip

Please try the above sample and let me know if it helps.

Regards,
Bala Murugan A.S


Blanca Calderon
Replied On January 3, 2011 05:24 AM

Thanks, it works fine!


Bala Murugan A.S [Syncfusion]
Replied On January 4, 2011 03:40 AM

Hi Blanca,

Thanks for the update.

Please let me know if you have any concerns and we will be happy to help you out.

Regards,
Bala Murugan A.S


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

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.

;