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

Drawing a node with multiple text zones

Hello

Suppose that you have to draw a node that has a rectangular shape but is divided "in two" (no need to be symetrical), and it is required to be able to write text in each half. What would you do?

Thanks a lot.


1 Reply

SR SubhaSheela R Syncfusion Team January 4, 2008 06:47 AM UTC

Hi EmoscosoCam,

Thank you for using Syncfusion products.

It is not possible to divide a rectangle into two half. But you can group two rectangle symbols together and then you can write text into that rectangle by placing Textnode in it.
Please refer to the following code snippet:

//To Group nodes
Syncfusion.Windows.Forms.Diagram.Rectangle nodeRect = new Syncfusion.Windows.Forms.Diagram.Rectangle(50, 100, 125, 75);
Syncfusion.Windows.Forms.Diagram.Rectangle nodeRect1 = new Syncfusion.Windows.Forms.Diagram.Rectangle(120, 0, 125, 75);
Syncfusion.Windows.Forms.Diagram.Group grp = new Group();
grp.AppendChild(nodeRect);
grp.AppendChild(nodeRect1);
this.diagram1.Model.AppendChild(grp);
// Text Node
string text = "Load BitmapNode";
MeasureUnits units = MeasureUnits.Pixel;
Syncfusion.Windows.Forms.Diagram.TextNode txtnode = new TextNode(text);
txtnode.Text = text;
txtnode.SizeToText(new SizeF(400, 400));
((IUnitIndependent)txtnode).SetPinPoint(new PointF(115, 135), units);
this.diagram1.Model.AppendChild(txtnode);
string text1 = "Load BitmapNode";
MeasureUnits units1 = MeasureUnits.Pixel;
Syncfusion.Windows.Forms.Diagram.TextNode txtnode1 = new TextNode(text1);
txtnode1.Text = text1;
txtnode1.SizeToText(new SizeF(400, 400));
((IUnitIndependent)txtnode1).SetPinPoint(new PointF(235, 135), units1);
this.diagram1.Model.AppendChild(txtnode1);

Kindly have a look into the link given below that illustrates the same:
http://websamples.syncfusion.com/samples/Diagram.Windows/F70811/main.htm
Please let me know if you have any questions.

Regards,
Subhasheela R




Loader.
Live Chat Icon For mobile
Up arrow icon