Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dynamically Size A Text Box
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00481579
Message ID:
00481598
Views:
10
>Fred,
>
>Here's what I'm doing to test all this:
>
>
>cTestVal = "Client"
>cFontName = "Arial"
>nFontSize = 9
>nWidth = CEILING(FONTMETRIC(6, cFontName, cFontSize) * TXTWIDTH(cTestVal, cFontName, cFontSize))
>
>_Screen.AddObject("MyText", "Textbox")
>_Screen.MyText.Width = nWidth
>_Screen.MyText.FontName = cFontName
>_Screen.MyText.FontSize = cFontSize
>_Screen.MyText.Value = cTestVal
>_Screen.MyText.Visible = .T.
>

>
>The word 'Client' is truncated in the visible portion of the text box

You'll need to allow for border size, etc. (extra space). The .Width property is NOT the visible space. The visible space would be the .Width - 2*border + couple for good measure. :)
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Reply
Map
View

Click here to load this message in the networking platform