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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Connector''s decorator

Thread ID:





81889 May 22,2009 07:15 AM UTC May 26,2009 09:08 AM UTC WinForms 4
Tags: Diagram
Veaceslav Cosulet
Asked On May 22, 2009 07:15 AM UTC

Hi everybody.
Does anyone know how to change default(a simple line between two ports) connector decorator's after activating LineTool?
How can I get a list of End Point Decorators?
Best regards, Frank.

Gowri Manohari D [Syncfusion]
Replied On May 23, 2009 05:57 AM UTC

Hi Frank,

Thanks for choosing Syncfusion Products.

The below is the code snippet for your first requirement.Code illustrates changing Decorators for LineConnectors.

LineTool line = (LineTool)diagram1.Controller.ActiveTool;
line.HeadDecorator.DecoratorShape = DecoratorShape.Filled45Arrow;

Please provide the some more details about your second question.

Thanks & Regards,

Veaceslav Cosulet
Replied On May 25, 2009 08:35 AM UTC

Thanks Gowri.
As for the second question, under below link below one can see all types of decorators in a window

Is it possible to get them all, I mean types of decorators, in such a window or I have to customize it myself in order to get them in such a window, or a ComboBox ???
Best regards, Frank.

Veaceslav Cosulet
Replied On May 25, 2009 10:40 AM UTC

Hi again Gowri.
I wrote the bellow code in order to change line end decorator,

LineConnectorTool lineConnector = (LineConnectorTool)diagram1.Controller.ActiveTool;
lineConnector.HeadDecorator.DecoratorShape = DecoratorShape.Filled45Arrow;

but gained the following error:

System.InvalidCastException was unhandled
Message="Unable to cast object of type 'Syncfusion.Windows.Forms.Diagram.SelectTool' to type 'Syncfusion.Windows.Forms.Diagram.LineConnectorTool'."
at TrySyncfusionComponents.Form1.button1_Click(Object sender, EventArgs e) in C:\Documents and Settings\cosulet\My Documents\Visual Studio 2008\Projects\TrySyncfusionComponents\TrySyncfusionComponents\Form1.cs:line 28
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at TrySyncfusionComponents.Program.Main() in C:\Documents and Settings\cosulet\My Documents\Visual Studio 2008\Projects\TrySyncfusionComponents\TrySyncfusionComponents\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

In order to solve it I wrote

LineConnectorTool lineConnector = (LineConnectorTool)diagram1.Controller.ActiveTool;
lineConnector.HeadDecorator.DecoratorShape = DecoratorShape.Filled45Arrow;

But in a warning it was said that LIneLinkTool is obsolete. One should use LineConnectorTool instead.

Does diagram1.ActivateTool("LineLinkTool"); activate LineLinkTool, or LineConnectorToll instead???
Thnaks and regards, Frank.

Gowri Manohari D [Syncfusion]
Replied On May 26, 2009 09:08 AM UTC

Hi Frank,

Thanks for choosing Syncfusion Products.

I could reproduce your error.While activating LineConnectorTool,system throws an error.Because no tool is available with the name LineConnectorTool,thats why it shows default SelectTool.

LineConnectorTool is referred with the name as LineLinkTool.Instead of using LineConnectorTool,you can use LineLinkTool.Refer the sample code below.

LineConnectorTool con = (LineConnectorTool)diagram1.Controller.ActiveTool;
con.HeadDecorator.DecoratorShape = DecoratorShape.Filled45Arrow;

Thanks & Regards,


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.

Please sign in to access our forum

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

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