?
Solved

VB6 Force Font Size on Form, Ignore Settings/Large Fonts in VB6

Posted on 2004-04-25
6
Medium Priority
?
968 Views
Last Modified: 2013-12-03
Hello All!

I've got an application that uses a specific font (Tw Cen MT Condensed). My installer provides the font without problem.  However, I've found that some users have their system fontsize set to /Large or /ExtraLarge.  This causes most of the labels on my application's forms to display improperly.  Note:  I really need to use this font because I need the screen real estate it provides.

So......

My question is:   Is there a way to FORCE fontsize in my application?  Can I override the users system/fontsize setting for my application only?

Thanks in advance for the help!

JWB
0
Comment
Question by:jwbryant
[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
6 Comments
 
LVL 2

Expert Comment

by:taherzm
ID: 10911837
You might want to consider using images for labels instead...this way what ever the font setting maybe the label size will remain same...
0
 

Author Comment

by:jwbryant
ID: 10911899
Thanks for the quick comment!

The primary reason that I chose to use labels is so that I can programatically re-brand the application by changing a single line in the app INI file.  So, I'm afraid that I'm stuck with labels.

Thanks!

JWB
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 1000 total points
ID: 10912073
Could you not set the fontsize yourself in code? say on a load of a form

Was wondering if you created a function which takes a form as a parameter

then this function can go thru the controls and set fontsize


This is just an idea, I havent got VB installed so I cant test it,

e.g.

Form_Load function

   SetFontSizes Me



then function SetFontSizes(byval Me As Form)

   Foreach ctrl in Me.Controls
      if ctrl.Type = ... then ctrl.FontSize ..
   next


Note the above code is just like pseudo code, not proper VB, as I am not sure of the exact syntax
0
 
LVL 3

Expert Comment

by:Phoenixric
ID: 10927179
Hi,

If you think you get stuck with labels, you can override the fontsize in your application using the label fontsize property.

Sample code:

Private Sub Form_Load()
    Label1.FontSize = 12
End Sub

Please get back to me if this doesn't work.
0

Featured Post

Industry Leaders: 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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Simple Linear Regression

762 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