Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determing form size necessary to display arbitrary text
Message
From
30/10/2001 22:44:29
 
 
To
30/10/2001 15:35:51
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00575284
Message ID:
00575454
Views:
29
Claudio,

Thanks for your idea about setting a control's Autosize property to .T. and then determining the height of the control. Very clever! Unfortunately the edit control does not have an Autosize property. The label control has an autosize property, but its text value must be less than 256 characters.

Any other suggestions?

Thanks!
Malcolm


>Hi Malcom;
>
>>Is there a way to determine the size of a form (window) necessary to display a text string using a specific font given a specific width for the form (window) and assuming that text wrapping is occurring? As an example, given a window 160 pixels in width, how many pixels high must this window be in order to display the string 'Blah blah blah ... blah' using an Arial 10 point font?
>
>Just set .t. to the object's autosize.. Give it the string 'Blah blah blah ... blah' and them do something like:
>
>if thisform.width+thisform.text1.width + ....>nMy_maxwidth
> *
>else
> thisform.width = thisform.text1.width + ...
>endif
>
>CLAUDIO
>
>>
>>I understand that there are text metric functions that will tell me the pixel length of a string but my understanding is that these functions do not take into account word wrap, i.e. they only return length assuming a single, non-word wrapped line of text.
>>
>>Any suggestions would be appreciated.
>>
>>Thanks!
>>Malcolm
Malcolm Greene
Brooks-Durham
mgreene@bdurham.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform