Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determine number of rows of text in an edit box?
Message
 
 
To
22/02/2005 02:57:35
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8
Miscellaneous
Thread ID:
00988886
Message ID:
00989909
Views:
31
Thank you Cetin. Do you happen to know, will that always work with precision, or is it just a really good guess? For example, what happens if there are some really long words in the string (like some long file names without spaces) that can cause choppy wordwrapping? Will memlines calculate wordwrap exactly the same as the editbox control? I wish there was a way to interrogate the control directly, even if it required an API call.

>>How do I determine the number of rows of text that are currently occupying an edit box? This includes accounting for automatic wordwrapping plus processing of CR's within the contents.
>
>
>lnOldMemoWidth = set('memowidth')
>with myEditBox
> SET MEMOWIDTH TO floor(.Width/(FONTMETRIC(6,.FontName,.FontSize)+1))
> lnLines = memlines( .Value )
>endwith
>set memowidth to m.lnOldMemoWidth
>
Cetin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform