Labels and font sizes

How can I print font in ANY sizes (not just whole numbers)?  I'd like to be able to make a resizable label, that shrinks the font when the label gets smaller.

Thanks,
-Sam
LVL 1
samsonite1023Asked:
Who is Participating?
 
amebaConnect With a Mentor Commented:
"VB silently uses the closest valid font size that is less than the requested size"
http://www.vb2themax.com/Item.asp?PageID=TipBank&ID=285

Maybe you can change kerning (spacing between characters), to make smoother changes:
http://www.vbaccelerator.com/codelib/gfx/textefx.htm
0
 
samsonite1023Author Commented:
Know of any API calls I can use to make font any size?
0
 
amebaCommented:
Any size - no.
There is a CreateFontIndirect API, which can set many properties, but not ANY size.
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
amebaCommented:
Another option is to use ExtTextOut - it can fit a rectangle, by adjusting space between characters.
0
 
samsonite1023Author Commented:
That is exactly what I need.. please tell me more!

Also, I could work with the kerning thing, but how can I get the DC of a label? (if it has one)

Thank you so much for your help

-Sam
0
 
amebaCommented:
You cannot draw on a label - it doesn't have DC or Hwnd property, it's windowless control.
I thought you were creating your own control.
0
 
samsonite1023Author Commented:
Yes, but it uses a visual basic label.

I needed the autosizing capabilities of it.

Should I just draw directly onto the UserControl window?  I guess that would give me much more options.  I could have an invisible label that finds the size of the text.

Thanks for your help

-Sam
0
 
samsonite1023Author Commented:
Do you know of any way to find the width of text? (via API)

If I can find that, I'll be set.

Thanks,
-Sam
0
 
amebaCommented:
Sorry, I stopped answering because of some issues with EE.  Feel free to ask for refund of points in Community Support topic area: http://www.experts-exchange.com/commspt/
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.