Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Wrapping Edit Box contents
Message
De
22/06/2007 14:29:58
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01234940
Message ID:
01235083
Vues:
16
>>>Hi Guys
>>>
>>>I use an edit box to capture text that is to be used to generate another message and would like to ensure that the text maintains the same wrapping as it appears in the edit box ? How can I achieve this ?
>>
>>You'd need to insert your own carriage returns (chr(13), that is) where you think it's appropriate. Set Memowidth to a value you find (default is 50 characters, may be what you want) and then experiment so that the lines you get are not too long for any of your situations.
>>
>>To chop the string:
>>
>>
lParameters lcOld
>>set memowidth to {your value here}
>>lcNew=""
>>_mline=1
>>for i=1 to memlines(lcOld)
>>   lcNew=lcNew+mline(lcOld,1, _mline)+chr(13)
>>endfor
>>return lcNew
>>
>>You may also want to save and restore the set("memowidth").
>
>Ha. I also was thinking about this problem and I figured it would be almost impossible without using own CHR(13) instead of relying on internal wrappings.
>
>I could not figure a way to do otherwise.

An alternative solution would involve using txtmetric() and would still be unpredictable if the two editboxes didn't use identical fonts. And if one of them was on a report, then all bets are off. With this way of hardcoding the line breaks, they'll at least break at the same places, at the price of text maybe looking too narrow in one of them.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform