SpellCoder

Welcome to SpellCoder Sign in | Join | Help
in Search

Beckham

Wrap ContinuousText Inside Label

Hey guys, I was wondering if any of you has the situation of displaying a text in a label?? sure you did. but imagine the text is tooooo long that it's displayed in a long line, Now if you put it in the label it will be displayed in a long line too, to solve this problem there is a lot of solutions you will find if you google it. you can use a textbox and give it the look of a label and set the wrap property to true this will do the trick. but what if you have a devil user or actually " QE Teammate ", and the text he entered is continuous as it was one word in this case it will not be wrapped. so here is a littel extension string helper method that warps the string into lines of length given as a parameter.
The idea here is to devide the string into lines and put a line break tag at the end of the line. 

 

Ofcourse it has some drawback such as the last word of the line might be splitted.but you can put "-" or something like this at the end of the line.

Hope this is helpfu, The source code is attached.

Beckham

 

Published Friday, April 11, 2008 8:37 AM by beckham
Filed Under: ,
Attachment(s): WrapText.zip

Comments

 

tayseer said:

Nice post
April 16, 2008 12:28 PM
Anonymous comments are disabled

This Blog

Post Calendar

<April 2008>
SuMoTuWeThFrSa
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

Syndication