Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Can't get trimming to work in ShapeNode (Read 1950 times)
jf2020
Junior Member
**
Offline


I love FlowChart!

Posts: 63
Joined: Feb 23rd, 2006
Can't get trimming to work in ShapeNode
Nov 24th, 2009 at 3:17pm
Print Post  
Good day,

I 'm trying to get an ellipsis a the end of the text when it doesn't fit in the bounds.

For that I'm doing
Code
Select All
box.TextFormat.Trimming = StringTrimming.EllipsisCharacter 


but I don't get the ellipsis to show.
I did a search and found a post about the same thing but in table cell. I have tried to set
Code
Select All
 EnableStyledText =false 


but that didn't help.

What am I doing wrong?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Can't get trimming to work in ShapeNode
Reply #1 - Nov 24th, 2009 at 3:25pm
Print Post  
Try also setting PolygonalTextLayout = false.
  
Back to top
 
IP Logged
 
jf2020
Junior Member
**
Offline


I love FlowChart!

Posts: 63
Joined: Feb 23rd, 2006
Re: Can't get trimming to work in ShapeNode
Reply #2 - Nov 25th, 2009 at 7:55am
Print Post  
Thanks! This indeed works now.  Smiley

As an additional question I was wondering if there's an easy way to know if the text is trimmed. I'm using the box as a label and I would like to set a tooltip to it containing the full text, but only when the text is trimmed.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Can't get trimming to work in ShapeNode
Reply #3 - Nov 25th, 2009 at 8:21am
Print Post  
You could use the Diagram.MeasureString method to check if the string is larger than node.Bounds. I'm not sure how it will work with text wrapping enabled though. The override that takes maxWidth argument might be useful in such case.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint