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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting number of lines

Status
Not open for further replies.

cyberbob999

Technical User
Jun 26, 2003
23
US
I have a form that is viewed in continuous forms. One value (txtComment) varies in length from only a few words to 3 or 4 sentences. Ideally what I'd like to do is vary the size of the text box on the form such to fit the amount of text. Something like the cangrow property would be nice (perhaps such a property exists for screen display, but I can't find it).

However, what I've done is just pick an intermediate sized text box and then use the scroll bars if necessary. If the amount of text is larger than the text box, at first glance it's not obvious that there is more to be read. So, what I'd like to do (assuming I can't figure out how to make the text box variably sized) is to be able to count the number of lines within the text box and if it exceeds 4 (the size of the box) then a "more" label will be enabled that shows that there is more text to read. I can't seem to figure out an easy way to count the number of lines within the text box, though... any suggestions?

Thanks
 
The CanGrow property does exist for a text box. Make sure in the property dialog box, you are looking under the "Format" tabl or the "All" tab.
 
Yeah, I know that the cangrow property exists for a text box, but isn't that ONLY for printing? I know that when I set it to yes it makes no difference (on the screen) and the desciption specifically says "Control or section expands vertically when printed to fit text"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top