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

SymbolLabel size not recalculated after font modification

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

4 Replies

RD Richard Deverson 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


AD Administrator Syncfusion Team 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.,


RD Richard Deverson 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


AD Administrator Syncfusion Team 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.

Loader.
Live Chat Icon For mobile
Up arrow icon