Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
06-23-2008, 05:10 PM #1
- Join Date
- Apr 2007
- Thanked 0 Times in 0 Posts
Get string on visual line (not wordwrapped) in a wordwrapped textarea?
Hi is there an easy way (method, property) to get the string occupying a "visual line" in a wordwrapped textarea?
What I mean by visual line:
A string of characters that does not spill into the line below it and occupies one line on the textarea, even if this line strays into the right-side scrolling portion of the textarea. How would a wordwrapped textarea manage to have a horizontal scroll bar you ask? Well, a line will have horizontal scrollbar when the # of chars occupying the line are more than the width dimensions of the textarea AND there are no spaces in the line. ie: sdddddNOSPACESddddddsddddddddddddddddddddddd
A simpleton solution is to determine where there are linebreaks and after that determine where there are more characters than what fits on a line. That in itself is a debatable matter, because how many characters that fit on a textarea line depend on their pixel width which is not uniform for all characters in the same pixel setting. IE: in the same pixel size the char 'a' will have different pixel width than '.'
A line full of '.' will have more characters occupying it than a line full of 'a'
-thanks for reading