Solved

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

Posted on 2014-04-11
3
505 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 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

615 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