Orthogonal lines and line colors

hello,
I'm still using the SyncFusion diagram to draw rooms, i want to draw segments(lines) wich will be the room's wall.
When i activate the LineTool ( like you described in the samples) it only draws a black line.. i want to be able to draw a red line while am draging the cursor and when the mouse is up, the line drawed will return to it's black state.. i tried to use the linestyle property but it's useles

The attached zip contains a word doc wich shows exactly what i am trying to do with pictures.
I would be thankfull if you could help me in resolcing the issue

Sincerly, Elia Chkayra


diagram4.zip

1 Reply

J. J.Nagarajan Syncfusion Team August 6, 2007 05:44 PM UTC

Hi Elia,

Thanks for your interest in Syncfusion product.

If you want to change the color of the LineConnector while activating the LineTool, then 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);
this.diagram1.Controller.RegisterTool(linetool);
this.diagram1.Controller.ActivateTool(linetool);

I have attached the sample that demonstrates this completely. You can download the sample from the following page.

http://websamples.syncfusion.com/samples/Diagram.Windows/F66947/main.htm

Please refer to it and let me know if you have any questions.

Regards,
Nagaraj



Loader.
Up arrow icon