Hi,
What you want is an algorithm that takes into consideration the width of the
label control, the number of characters and the font size. In addition, you
may have to distinguish between caps and lower case, as these will differ
even if the font size is the same; also, spaces and other elements of
punctuation will have to be considered, as will the font face, as these too
can differ even if the point size is the same. You might even have to
consider kerning (the adjustment of space between pairs of letters to make
them more visually appealing). Finally, if the font size that is determined
by the algorithm is large enough, you might be forced to increase the height
of the label control to accommodate each character.
And that is why there is no function for it - it's very complicated, but I
would imagine doable.
HTH,
Bernie Yaeger