Count Lines in a text box

LHolden

Registered User.
Local time
, 22:43
Joined
Jul 18, 2012
Messages
73
Hi all,

I have a memo field that feeds to a textbox control on one of my forms. I would like to re-format the textbox using the .Height value based on how many lines appear in it (i.e. it will fit only 3 lines if there are 3, but 5 lines if there are 5, etc.).

Is there any way to count the number of lines that appear in the textbox?

Thanks
 
No. But you can count how many characters there are in your memo. But honestly, don't muck about with stuff like this - what is the gain and at what cost?
 
Yea, it was only for aesthetics, but I'm an aesthetics kind of guy. Thanks for your response though, and I'll abandon this hope for now.
 
I'm sure there is code available to do this or at least a good example. I'm thinking Lebanan's site, but don't really know where I've seen it. I do recall it had an issue and that is some fonts do not have evenly spaced characters in other words it doesn't work properly on some fonts.
 

Users who are viewing this thread

Back
Top Bottom