Inconsistent fonts in visual basic .net forms

Hi,
I'm developing a VB.NET Windows system in Visual Studio 2008. I have several forms and would like all the text to adjust size using the autoscalemode=FONT property setting.

All of my forms have autoscalemode=FONT, and all components are set to a font size of 8 (same style) but some components are still staying the original size, no matter what. It appears to work fine on one or two screens, then not on others.

The only difference I can see is:

The components (labels, comboboxes, textboxes)  that do not use the autoscalemode=FONT correctly (and default to the size 8 font) show their font property "bolded" in Visual Studio. (click the component, press F4, look at the font settings, the text is bolded)
The Form Font property is also bolded!

The components that are displaying correctly (at run time), are not bolded in Visual Studio. (The form property on these is not bolded.)

Also - I noticed:
In the Designer.vb files, the forms that show correctly ONLY have FONT set for the form - and it's the autoscalemode=font setting.

The other forms have font settings on all of the individual components.

Removing the individual Font settings from the designer did not work - they kept showing back up.

I need consistency across these forms (some of this even happens within the same form ..one component adjusts, the others stay small).

All form components are set to the exact same font style and size.
All forms are set to autoscalemode=FONT.

Is there a property somewhere that overrides the autoscalemode=FONT, that I am missing??
Is this an oddity in Visual Studio 2008?  Is there a fix?

I'd appreciate any input - this needs to go on the user's machine THIS week!

Thanks in advance,
Mary Z
mz64Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
1) AutoScaleMode has problems:

WinForms AutoScaleMode - Your One-Way Ticket to Pain & Suffering
http://geekswithblogs.net/codesailor/archive/2007/02/15/106424.aspx

2) Have you tried AutoScaleMode = DPI?  Try a test app to see what the difference is with the problematic controls that you identified.

3) Removing the font from individual components means removing those settings from the .Designer.vb files.  There are two ways to remove, that I know of:  1) highlight the Font settings for each control in the Property Grid, and press the <Del> key to delete any overrides, or (2) open the .Designer.vb files in the code editor, and search for and remove manually.  I prefer #1 for small changes, and #2 for bulk changes.

4) Editing the .Designer files requires a little explanation:

     a) For VB.NET solutions, the .Designer.vb files are not visible unless you check the "Show All Files" option in the Solution Explorer

     b) The font information is set in the InitializeComponent method

        This is a TextBox without a font:

        '
        'TextBox1
        '
        Me.TextBox1.Location = New System.Drawing.Point(95, 75)
        Me.TextBox1.Name = "TextBox1"
        Me.TextBox1.Size = New System.Drawing.Size(100, 20)
        Me.TextBox1.TabIndex = 0

        This is a TextBox with a font:

        '
        'TextBox2
        '
        Me.TextBox2.Font = New System.Drawing.Font("Calibri", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TextBox2.Location = New System.Drawing.Point(269, 66)
        Me.TextBox2.Name = "TextBox2"
        Me.TextBox2.Size = New System.Drawing.Size(100, 23)
        Me.TextBox2.TabIndex = 1

        c) Search for and delete any lines for individual controls that have a .Font =
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mz64Author Commented:
Thanks oh LearnedOne!

I will probably leave it as FONT for now just for consistency's sake. If I have time I may try DPI again (tried it before, but didn't have a desktop to truly see the differences).

This was the ticket to success:
"1) highlight the Font settings for each control in the Property Grid, and press the <Del> key to delete any overrides"
It cleared things out so the autoscalemode could take over.

Yay!
Thank you, Thank you, Thank you!

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.