Solved

Labels and font sizes

Posted on 2002-07-06
9
367 Views
Last Modified: 2013-12-02
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
Comment
Question by:samsonite1023
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 15

Accepted Solution

by:
ameba earned 75 total points
ID: 7134609
"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
 
LVL 1

Author Comment

by:samsonite1023
ID: 7136074
Know of any API calls I can use to make font any size?
0
 
LVL 15

Expert Comment

by:ameba
ID: 7136298
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!

 
LVL 15

Expert Comment

by:ameba
ID: 7136426
Another option is to use ExtTextOut - it can fit a rectangle, by adjusting space between characters.
0
 
LVL 1

Author Comment

by:samsonite1023
ID: 7136872
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
 
LVL 15

Expert Comment

by:ameba
ID: 7137197
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
 
LVL 1

Author Comment

by:samsonite1023
ID: 7137427
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
 
LVL 1

Author Comment

by:samsonite1023
ID: 7137665
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
 
LVL 15

Expert Comment

by:ameba
ID: 7137712
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

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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question