a simple solution to use a font with all the char has the same width like
"courrier new" (don't know the english name of the font)
then a simple calcul on the text.len gives the with.
int OneCharWidth = 8; // 8pixels
myLabel.width = (myLabel.text.len + 1)* (OneCharWidth );
It is not very ellegant, but simple and it works
hopes that's help.
"Thore Berntsen" <(E-Mail Removed)> a écrit dans le message de news:
#(E-Mail Removed)...
> Say I have a label on a from, and I put some text in it. How do I
calculate
> the needed size (width and height) of this label so that the whole text is
> shown?
>
> Thore Berntsen
>
>