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 do I change the color of the LineConnector when activating the line tool?

Platform: WinForms |
Control: Diagram

Change lineConnector color

You can change the color of the LineConnector while activating the LineTool. You have customize LineTool and LineBase class. In the Mouse up event of LineTool class you can change the color of the link.

Please refer to the following code snippet in CustomLineConnector class.

public override Tool ProcessMouseUp( MouseEventArgs evtArgs )
CompleteAction( ptStart, ptEnd );
private void CompleteAction( PointF ptStart, PointF ptEnd )
Node node = CreateNode( ptStart, ptEnd );
node.LineStyle.LineColor = Color.Red;
//To activate the LineTool in MainForm.cs
MyLineTool linetool = new MyLineTool(this.diagram1.Controller);
Public Overrides Function ProcessMouseUp(ByVal evtArgs As MouseEventArgs) As Tool
CompleteAction(ptStart, ptEnd)
End Function
Private Sub CompleteAction(ByVal ptStart As PointF, ByVal ptEnd As PointF)
Dim node As Node = CreateNode(ptStart, ptEnd)
node.LineStyle.LineColor = Color.Red
End Sub
''To activate the LineTool in MainForm.cs
Dim linetool As MyLineTool = New MyLineTool(Me.diagram1.Controller)


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