Information générale
Catégorie:
Codage, syntaxe et commandes
Here's a method I've used:
The Form class has a TextWidth method that returns the width of a string based on the current font. You can write your own method that will pass an object, will set the font of the form to the characteristic of the font of the object, get the TextWidth and restore form's font.
Please note that _SCREEN is also a form and if you don't use it in your programs, you don't need to restore its font.
Vlad
>I seem to be having a problem calculating the length of a text string. I tried the txtwidth() function and and fontmetric() function as shown in the txtwidth() help examle and I am getting nowhere. All I want to do is find the lenght of a string so I can auto size the box or command button it appears in.
>
>As usual, many thanks to all who help.
>
>John J. Henn.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement