|
-
Feb 20th, 2002, 02:32 AM
#1
Thread Starter
Lively Member
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.
-
Feb 20th, 2002, 02:46 AM
#2
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
-
Feb 20th, 2002, 02:51 AM
#3
Thread Starter
Lively Member
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.
-
Feb 20th, 2002, 02:57 AM
#4
Couldn't you just set the AutoSize property to True?
-
Feb 20th, 2002, 03:17 AM
#5
Thread Starter
Lively Member
No I can't set the AutoSize property to True as I have space restrictions.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|