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

nodes behind or at the front

Hi,

I have two nodes, a text node and a rectangle node. I would like to put the text at the front and the rectangle behind so that, when I select the text, this is the first you select.

It is like in a word document, when you insert a shape you could put an order, behind, at the front....

Could you help me?

Thanks

 

 

 


1 Reply

AA Amsath Ali M Syncfusion Team May 20, 2013 11:43 AM UTC

Hi Blanca,

 

Thanks for your interest in Syncfusion products.

 

We suggest you to use the Diagram.Controller’s ‘BringToFront’ method to bring the selected node to the front of the Z-order. Please refer the below code snippet to achieve your requirement.

 

Here is the code:

[C#]

TextNode txt = new TextNode("Bring the textNode to front", new RectangleF(100, 100, 100, 70));

            diagram1.Model.AppendChild(txt);

 

            Syncfusion.Windows.Forms.Diagram.Rectangle rect = new Syncfusion.Windows.Forms.Diagram.Rectangle(100, 100, 100, 70);

            diagram1.Model.AppendChild(rect);

 

            diagram1.View.SelectionList.Clear();

            diagram1.View.SelectionList.Add(txt);

 

            //Brings the selected nodes (textNode) to the front of the Z-order.

            diagram1.Controller.BringToFront();

 

For more information, please visit the below UG documentation link:

http://help.syncfusion.com/ug/windows%20forms/diagram/documents/diagrambuilder.htm

 

Please refer the below attached sample and let us know if you have any queries.

 

Regards,

Amsath Ali. M



F108819_e0370f10.zip

Loader.
Up arrow icon