Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dynamically Size A Text Box
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00481579
Message ID:
00481598
Vues:
9
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform