Solved

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

Posted on 2014-04-11
3
458 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
  • 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 500 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

776 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