Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Center or truncate text in a ShapeNode (Read 1008 times)
tmtton
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 39
Joined: May 9th, 2008
Center or truncate text in a ShapeNode
Dec 5th, 2008 at 5:16am
Print Post  
I have a fixed-size ShapeNode that contains a single line of text with varying length. I want to center a short text and truncate the long text. The StringAlignment.Center doesn't work, my text stills aligns left.

node.Text = "some text string";
node.TextFormat.FormatFlags=StringFormatFlags.NoWrap;
node.TextFormat.LineAlignment=StringAlignment.Center;
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Center or truncate text in a ShapeNode
Reply #1 - Dec 5th, 2008 at 10:03am
Print Post  
LineAlignment sets the vertical alignment. Set TextFormat.Alignment = Center to set the horizontal alignment.

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