Count Lines in a text box (1 Viewer)

LHolden

Registered User.
Local time
Today, 10:00
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
 

spikepl

Eledittingent Beliped
Local time
Today, 15:00
Joined
Nov 3, 2010
Messages
6,144
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?
 

LHolden

Registered User.
Local time
Today, 10:00
Joined
Jul 18, 2012
Messages
73
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.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 14:00
Joined
Jul 9, 2003
Messages
16,245
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

Top Bottom