-
Label Auto sizer
I have a label say label1. When ever I enter some words which is more than what can be shown in that label it truncates the surplus words and displays the label. Like say if label1 can only 10 words then if I enter this "Information Technology" then label1 only shows "Informatio" nothing else. I want this to automatically adjust the font of the lable so that the entire "Information Technology" fits into it. In other words if the sentence is more it must reduce its font size and finally fit it in the label. The logic is : The font must go on reducing till the entire sentence is fitted into. The reverse must also work if less is entered then font size should increase. Please help with codings. Thanks.
-
don't u think the font will get awfully small if type, um, say "waka waka length, blah blah, telephone, more stuff"?
maybe resize the label?
but, have a look at:
Public Declare Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32A" (ByVal hDC As Long, ByVal lpsz As String, ByVal cbString As Long, lpSize As Size) As Long
or even
[Form name].TextWidth
-
Font won't get awful as I am allowing the user to preview the font. If it is worse then he can remove some words by editing.
-
Couldn't you just set the AutoSize property to True?
-
No I can't set the AutoSize property to True as I have space restrictions.