Click here to Skip to main content
15,888,062 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
There seems to be two ways of changing the text size in Windows 10:

1. "set a custom scaling level" - which allows you to set the system to 96-dpi, 120-dpi, etc. My application detects this fine. My 1920x1080 screen is detected as 1920x1080 fine.

2. On a screen by screen basis by with the "Change the size of text, apps, and other items" option per screen. My application doesn't detect this and my 1920x1080 screen shows up in my program as 1536x864 pixels.

First thing I need to do is detect number 2 above and adjust the number of pixels collected from:

Dim Screens() as Screen = Screen.AllScreens

which is showing 1536x864 pixels.

I am using Framework 4 (I still have clients using Windows XP, so can't move).

Any help would be appreciated. Thanks.
Posted
Comments
Sergey Alexandrovich Kryukov 17-Nov-15 10:17am    
Making text size depending on screen size looks like utterly bad approach in almost all cases. Application usually has resizable window and floating layout, so the context is shown nicely in any size between MinimumSize and screen...
—SA
Wedgwood 18-Nov-15 5:50am    
Just to clarify, the application scales fine. It's the detection of the correct screen resolution when Windows 10 is using the "Change the size of text, apps, and other items" option per screen that is the issue. Thanks.
Sergey Alexandrovich Kryukov 18-Nov-15 12:28pm    
All right, great. Then I would like to understand why you want to "detect" it. Is the problem is capturing the event of changing this system-wide property during application runtime? Anything else?

(By the way, "resolution", despite the wide use, by Microsoft (notoriously messing up terminology, sometimes to real serious confusion, like in case of "Unicode") and others, is a wrong term. This is just a size of screen in pixels. Resolution is related to the characteristic of system to resolve lines/points, measured in dots per mm/inch.)

—SA
Wedgwood 19-Nov-15 4:43am    
Windows Display in the Control Panel is showing the screen as having 1920x1080 pixels. At a text size of 100%, then using the .NET:

Dim Screens() as Screen = Screen.AllScreens

On a single screen system, with custom scaling set to either 96 or 120 dpi, Screens(0).Bounds.Width equals 1920 and Screens(0).Bounds.Height equals 1080.

Now heres the problem. With Windows 10, if the user uses the Change the size of text, apps, and other items" option per screen, then the screens code returns different values. I.e. Screens(0).Bounds.Width equals 1536 and Screens(0).Bounds.Height equals 864 instead.

I guess I need an alternative way of collecting the screen information.
Sergey Alexandrovich Kryukov 19-Nov-15 11:53am    
Thank you for answering. Now, did I understand it right? Is the only issue when the user changes screen settings during your application runtime, or do you detect the screen size in the very beginning? Do you scale (not just resize) the application depending on that? You may think that what you are trying to do is obvious, but it's not. Most application don't try to maintain certain size of aspect ratio at all. You maximize window, and it takes appropriate size, the user resizes it, and it takes new size without any scaling; and still everything is shown fine, despite extremely low sizes, which can be limited. Essentially, from the very beginning, I was trying to ask what's wrong with this simple model, and what makes you designing something more complicated? Yes, I'm aware of different layout/scaling style where everything is measured in relative screen units. The goal is to maintain physical sized (in mm, not in pixels) for all elements on different hardware. Is that what you want to achieve? Something else?
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900