• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 374
  • Last Modified:

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
0
samsonite1023
Asked:
samsonite1023
  • 5
  • 4
1 Solution
 
amebaCommented:
"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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now