Solved

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

Posted on 2004-04-25
6
962 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
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 250 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

This article will show, step by step, how to integrate R code into a R Sweave document
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 …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

679 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