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

SymbolLabel size not recalculated after font modification

Thread ID:





34538 Sep 12,2005 03:11 PM UTC Sep 15,2005 01:51 PM UTC WinForms 4
Tags: Diagram
Richard Deverson
Asked On September 12, 2005 03:11 PM UTC

Hello, Still on the subject of symbol labels, sorry. I add a label to a Symbol, then I manipulate the label text properties, e.g. font size, style etc. Unless I force a "SizeToText" on the Symbol, the symbol will not be resized according to the new text properties, and the text may be truncated. Is this the intended behaviour? See code below: SymbolLabel symbolLabel = this.AddLabel(text,BoxPosition.MiddleRight) as SymbolLabel; //this is subclassed from Symbol if(null != symbolLabel) { //Set some defaults symbolLabel.OffsetX = 10; symbolLabel.OffsetY = 0; symbolLabel.FontStyle.Family = "Verdana"; symbolLabel.FontStyle.PointSize = 8.25F; symbolLabel.VerticalAlignment = StringAlignment.Center; symbolLabel.HorizontalAlignment = StringAlignment.Center; symbolLabel.DirectionRightToLeft = false; symbolLabel.NoClip = true; symbolLabel.WrapText = false; //What we DO have to do is manually force a resize of the symbol label, because some //text properties have changed. symbolLabel.SizeToText(); } regards Richard

Richard Deverson
Replied On September 12, 2005 03:13 PM UTC

PS. Forgot to mention, The symbol size is automatically recalculated if the SymbolLabel.Text is modified again after playing with the font etc. And this is all with V3.3.0.0 regards Richard

Administrator [Syncfusion]
Replied On September 12, 2005 03:53 PM UTC

Richard, Calling SymbolLabel.SizeToText() should do the trick. Are you having trouble with this? Thanks, Prakash Surendra Syncfusion Inc.,

Richard Deverson
Replied On September 13, 2005 08:56 AM UTC

Hi Prakash, Yes, SizeToText works fine, and I can live with it as is. My question was just whether the SizeToText should be done within the label class itself, e.g. whenever a font property is changed. regards Richard

Administrator [Syncfusion]
Replied On September 15, 2005 01:51 PM UTC

Richard, You are right about this. I will go ahead and log a QA report, and we will try to address the problem in a future update of the product. As always, thank you for bringing the issue to our attention. Regards, Prakash Surendra Syncfusion Inc.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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