Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2014-04-11
3
Medium Priority
?
531 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 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure 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 …
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

783 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