Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determine number of rows of text in an edit box?
Message
 
 
À
22/02/2005 02:57:35
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8
Divers
Thread ID:
00988886
Message ID:
00989909
Vues:
28
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform