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
close icon

How to make label / textnode fixed size

How do I configure a label or textnode such that the text doesn''t change it''s size. I want the text to clip to the bounds I''ve defined (otherwise there''s no way to layout things exactly as I want). I''d like for the label to do the "..." thing automatically if it doesn''t fit (a built in feature of many text-related controls in .NET).

Everything I try just causes the label or textnode to resize itself when the text doesn''t fit. :(

-- David

4 Replies

AD Administrator Syncfusion Team August 22, 2006 09:22 AM UTC


Hi David,

Thanks for your interest in Syncfusion products.

We are working on the query that you have raised here and will get back to you on this before the end of the day.

Thank you for your patience.

Regards,
Meera.


DW David Whatley August 23, 2006 07:56 PM UTC

Did you forget me? :)

-- David


AD Administrator Syncfusion Team August 24, 2006 04:52 PM UTC


Hi David,

My sincere apologizes for the delay in getting back to you.If you want to retain the Symbol Label''s size,then you can set a fixed value to the Symbol label within the Diagram.Property changed event.Please refer the following code snippet

private void diagram1_PropertyChanged(object sender, Syncfusion.Windows.Forms.Diagram.PropertyEventArgs evtArgs)
{
if(evtArgs.Node is Syncfusion.Windows.Forms.Diagram.Label && evtArgs.PropertyName == "Text")
{
//Set the fixed size to the SymbolLabel
label.Size=new SizeF(float width,float height);
}
}


Please refer the attached sample that demonstrate this completely and let me know if you have any questions. We will be glad to assist you.

Thank you,
Meera.

Fixed TextNode.zip


DW David Whatley August 26, 2006 02:50 AM UTC

I dunno... I''m generating lots of labels dynamically at run-time and they have different sizes. This doesn''t have a way of knowing what the size was before it changed. Doesn''t seem like a good solution... but also not sure how to get it to work in the situation I have (which is more real-world).

Any ideas?

-- David

Loader.
Live Chat Icon For mobile
Up arrow icon