1

In windows 8 there is a change the size of all items under display, where you can zoom everything by 100%-150%, is there a way to programatically change this using C#?

User
  • 1,118
  • 7
  • 23
Herrozerro
  • 1,601
  • 1
  • 22
  • 37
  • Are you talking about the "make everything bigger" option in the modern "PC Settings" control panel, or changing the DPI (which requires logout/in to take effect)? – Tawnos Aug 26 '13 at 15:12
  • Why do you want to alter a global user setting? Is your program meant to provide an access to this control, or are you trying to use it because of something else? I see in another comment you want to "ignore" this feature. What do you mean by that? – Tawnos Aug 26 '13 at 17:42
  • I have an application that is designed for 1900x1200, but some users have used the feature under settings to make everything larger by 125-150%, causing the application to not function properly. I was wondering if there was a way to either change this setting, but since it would require a log off, that seems to be out of the question. I guess I am wondering if an application can ignore it. – Herrozerro Aug 26 '13 at 17:55
  • You can always use compatibility settings to disable dpi scaling, but it might be better to just make your UI be DPI aware and handle it. There's a guide to solving DPI issues, here: http://msdn.microsoft.com/en-us/library/windows/desktop/dd464660%28v=vs.85%29.aspx – Tawnos Aug 26 '13 at 19:29
  • The answers here may be helpful (Windows 10): https://stackoverflow.com/questions/35233182/how-can-i-change-windows-10-display-scaling-programmatically-using-c-sharp – seanf Nov 21 '20 at 00:24

1 Answers1

0

I don't believe there are any API's to control this (I've looked before, but may have missed it). I know I've changed this setting on Windows 7 and it requires a logout/logon cycle. What Windows does is mess around with the device/font metrics so that your application is fooled into making the text larger on screen.

If you declare your application to be high-DPI aware, Windows will not do this for your app. You control this as you create each font instance in your application. All that windows offers is basically an option to defeat this automatic font metrics kludge on an application by application basis.

However, if you are writing Windows forms apps, you will want to look at the AutoScaleMode property as this may do what you actually want to accomplish.

Gary Walker
  • 8,831
  • 3
  • 19
  • 41
  • I have a Xmal application, is there a way to have it ignore this feature? – Herrozerro Aug 26 '13 at 15:56
  • I don't think there is, but I am not a XAML guy. You could use the "stretch" attributes on labels, etc. but this can be a bit of a pain to retrofit if you are not doing it. The ViewBox also has stretching that may be useful for you. – Gary Walker Aug 26 '13 at 16:54