Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
changeXy challenge 13 67
File.WriteAllLines problem at random C# ASP.NET 6 64
topping1 challenge 7 72
Filename to be appended with DateTimeof Download 3 40
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

919 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now