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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Alignment of lebel to TOP Left

Thread ID:

Created:

Updated:

Platform:

Replies:

89822 Sep 8,2009 09:08 AM UTC Sep 10,2009 03:59 AM UTC WinForms 1
loading
Tags: Diagram
Nikhil Nirmal
Asked On September 8, 2009 09:08 AM UTC

Hi,

I am using the sync fusion diagram control version (7.3.0.20)

I am using the symbol rectangle, in that symbol I want to add text so, I add label to that symbol and assign the text to that label.

Code e.g.

SymbolRectangle SymbolRectInput = new SymbolRectangle();

SymbolRectInput.Size = new SizeF(SymbolWidth, symbolHeight);

Syncfusion.Windows.Forms.Diagram.Label lblnameInput = new Syncfusion.Windows.Forms.Diagram.Label();

SymbolRectInput.Labels.Add(lblnameInput);

this.diagram.Model.AppendChild(SymbolRectInput);

SymbolRectInput.Labels[0].Text = strtextName;


Problem:-

Label of Text in Symbol is Center align. But I want that to Top Left align
Please help me, how to align label text to top left in symbol rectangle.






Aling Text_8ccc4449.zip

Gowri Manohari D [Syncfusion]
Replied On September 10, 2009 03:59 AM UTC


Hi Nikhil,

Thank you for choosing Syncfusion products.

Diagram label supports the Position property in order to position the label inside the node. Please refer the code snippet for more details.


Syncfusion.Windows.Forms.Diagram.Rectangle rect = new Syncfusion.Windows.Forms.Diagram.
Rectangle(50, 50, 150, 250);
Syncfusion.Windows.Forms.Diagram.Label lbl = new Syncfusion.Windows.Forms.Diagram.Label();
lbl.Text = "This is First";
lbl.Position = Position.TopLeft; //Position the label
lbl.UpdatePosition = true;
rect.Labels.Add(lbl);

Here lbl.UpdatePosition property will position the label at exact location.

Regards,
Gowri

CONFIRMATION

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.

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

;