0

I am working on a windows desktop application that will be used in various resolutions and text sizes. Before getting to AutoScaling and other ways for the desktop application to work, I need to see what the user sees.

Adjusting the resolution of my development machine is not good enough. The biggest kicker is the text size. Some users have it set to 125% of default which distorts practically everything.

Free tools like this only lets you play with resolutions, not text sizes.

Changing the text size in windows 10 is an ordeal, jumping through a lot of hoops. You have to log off and log back in. Also, when I open the project in Visual Studio with the text size change, the forms are jacked up. The form size is shrunk with all the controls outside.

user79284
  • 175
  • 1
  • 2
  • 18

3 Answers3

1

I'm not 100% sure what your asking about but i think this might help you

yourForm.AutoScaleMode = AutoScaleMode.Dpi;

Also here is more info on Scaling in Windows Forms: https://msdn.microsoft.com/en-us/library/ms229605.aspx

Or more info on writing DPI aware Win32 Applications: https://msdn.microsoft.com/en-us/library/windows/desktop/dn469266%28v=vs.85%29.aspx

  • The biggest question: Is there an easier way to see what the user see if the user changes the default text size (not just the resolution)? The only way is to change to text size, log off and log back in. – user79284 Apr 13 '16 at 00:44
  • Yes there is you can make a new Graphics var ill post a new answer about it – Tyler Gregorcyk Apr 13 '16 at 00:49
0

You can get the user windows display text size by making a new graphics object Example:

Graphics graphics = this.CreateGraphics();
flaot windowsFontSize = graphics.DpiX;
string fontSize = string.Empty;

if(windowsFontSize == 96f)
    fontSize = "Smaller";
else if (windowsFontSize == 120f)
    fontSize = "Medium";
else if (windowsFontSize == 144f)
    fontSize = "Larger";

Info found here: How to get Windows Display settings?

Community
  • 1
  • 1
  • Sorry, but I think we are still talking about different things here. My user has his size of text set to 125% of default (Control Panel -> Appearance and Personalization -> Display). With that size, a lot of things get distorted. I would like an easier way to see what he sees with that text size without jacking up my own machine and development environment (or using his machine). I am not talking about how to fix it YET. **I NEED TO SEE WHAT HE SEES** – user79284 Apr 13 '16 at 01:00
  • This will tell you what he has sellected if the windowsFontSize = 120 that means he had his text size set to 125% But if you want to see how long the string is with the selected font you can use 'Graphics.MeasureString(String, Font)' Info found here: https://msdn.microsoft.com/en-us/library/6xe5hazb%28v=vs.110%29.aspx – Tyler Gregorcyk Apr 13 '16 at 01:03
  • And if you are trying to simulate it the easiest way is to just switch the font size in your settings but if you do not want to do that you could always multiply the size of everything in your form by the amount your customer has it at – Tyler Gregorcyk Apr 13 '16 at 01:07
  • Thank you,and I am sure this will come in handy later when I implement a solution. But I was not talking about programmatically seeing what the user sees. I just need to see visually what the user sees when he opens up my form. Right now, I have to go to control settings, set the text size to $125%, shut down all my applications, log off and log back in. That is a lot of hoops to go through. Is there a easier way to deal with this? – user79284 Apr 13 '16 at 01:10
  • As i was saying in my first answer you can make it where the program scales down automatically by using 'yourForm.AutoScaleMode = AutoScaleMode.Dpi;' Then you wont need to simulate what they are seeing because it will scale the program down to what you see on there machines. Other then that as far as i know there is no way, you might be able to run a virtual machines and set its font size to 125% – Tyler Gregorcyk Apr 13 '16 at 01:11
  • I think i understand you problem now, the bests way to fix this is to run a virtual machine on you work computer. I can personal vouch for Parallels and VMware – Tyler Gregorcyk Apr 13 '16 at 01:19
  • Thank you. I can see where the confusion is. My title sucks. Thanks again. – user79284 Apr 13 '16 at 02:56
  • Sorry i couldn't help. I hope you have good luck in getting a answer :D – Tyler Gregorcyk Apr 13 '16 at 03:01
0

The only way to have the program run at 125% text scale without changing you text size in your settings or multiplying everything in your form by 125% is to run a virtual machine. I can personally vouch for Parallels and VMware. If you want to learn more about Virtual Machines you can read this: https://en.wikipedia.org/wiki/Virtual_machine

  • I was hoping for a screen emulator. Doesn't this mean having to get an OS license for each VM? – user79284 Apr 13 '16 at 02:44
  • Yes you need a OS license for each VM, but if you are working for a company most of the time they are willing to provide a license for you. – Tyler Gregorcyk Apr 13 '16 at 02:47