Solved

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

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
matchUp  challenge 9 71
python sqlite question 11 42
advertisement module in core php 4 81
Device same like our heart 12 45
This is an explanation of a simple data model to help parse a JSON feed
A short article about problems I had with the new location API and permissions in Marshmallow
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 …
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…

708 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

15 Experts available now in Live!

Get 1:1 Help Now