Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Functionality to end text if length exceeds width?

Status
Not open for further replies.

EdAROC

Programmer
Aug 27, 2002
93
US
Is there a function or technique to truncate and add ... to text when the length is going to exceed the width of the text box?
Example:
The big brown fox jumped over the fence
in a 1" width text box would be:
The big brown fo...
(Note not "drawn to scale".)
 
Yuo could use a fixed width font and the len() function, but it would not look nice....
 
LOL - That's good thinking. I should have thought of that one. My programming days go back to the 70s, when all we had were fixed width printers (band and dot matrix) and CRTs ("Green Screens").

Thanks. While it won't be the solution here, it's something to tuck in the back of my mind - the concept will be needed someday.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top