Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Form Font Scaling in Apps Installed on Windows 7-How To Stop?

Posted on 2014-04-11
3
Medium Priority
?
526 Views
Last Modified: 2014-04-23
I have an application programmed in Visual Studio and when installed on a Windows PC where the text is set to Medium or Larger, the text on my forms autosizes. Does anyone know how to stop the autosizing? I have tried changing the form option of AutoScaleMode to None along with other things but the text continues to autosize. If anyone could tell me how to stop this that would be great.

The Windows font size setting is under Screen Resolution, Make text and other items larger or smaller.
0
Comment
Question by:vb9666
[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
  • 2
3 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39995396
Did you turn off autoscaling at control level as well? Is it winforms or WPF app?
0
 

Author Comment

by:vb9666
ID: 39998951
It's a windows from application. And the controls are set to AutoSize = False. There is not autoscalemode property on the controls.
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 39999227
Disabling scaling would not fix the issue though. Here is an explanation

You'll have bigger problems when you change the AutoScaleMode property. Increasing the DPI also changes the system font size. Necessarily so, font sizes are expressed in points, 1/72 inch. The fonts need to be bigger to get the same point size when the DPI increases.

Since the controls don't get resized anymore, the text on, say, a button no longer fits. One way to battle this is to change the font size on the controls proportionally. Easy if you let all the controls inherit the form font, just changing the form's Font property automatically updates the controls as well. The clear disadvantage is that the user will have a harder time reading the text. This especially gets bad when the DPI goes to 150 DPI and beyond, your UI just becomes unusable.

Yes, background images need to get scaled to fit the larger control or form. A pixel in the image now no longer maps one-to-one to a pixel on the screen. The default Graphics.InterpolationMode value does a very decent job of filtering the image. But it depends on the kind of image how well that turns out. A photo almost always scales very well. Finely detailed line art does not. Picking the right kind of image goes a long way to avoiding having to create separate ones.

This problem isn't going to go away until monitors start to have the kind of resolution a printer has. We're still a long way from 600 DPI.




I had the same problem with one of my applications. The answer was to move it to WPF. The solution that I came with when I still used WinForms was to have 2 executable files. One developed under 96DPI and the other under 120DPI. It was double effort, but I have tried any layout configurations without success. If my controls were looking fine on 96DPI, when switching to 120DPI, they were out of the window's application. And viceversa.

WPF is the only solution to this annoying problem.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

704 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