0

I built an application on a computer with normal DPI size. It is a WinForms application with many forms and custom controls. When I open the project on my Lenovo Yoga 900 with high DPI it looks good in Visual Studio 2013 but when I run the application some parts are off screen.

Even worse is when I open the application after a change on my "normal DPI computer". Most of the controls are scaled up, margins and paddings are scaled too.

With other words my forms are messed up. I've read about the AutoScaleMode which is set to Font. Even I change that property there are not realy noticable changes.

Any suggestions how I can handle that problem? Or does someone have similar experiences/issues?

Skuami
  • 1,422
  • 2
  • 14
  • 28
  • Dealing with DPI is invariably very rough on a programmer that never dealt with the concept before. There are just certain things you should never do and always thought were entirely reasonable before. Like setting sizes and locations and hard-coding the pixel values. Gets especially hairy when there is a lot of that kind of code, hard to know where to get started fixing the problems. Take the smallest sample design that has this issue, and make sure you have a good backup, and start deleting stuff to focus on the problem. – Hans Passant Sep 02 '16 at 08:24
  • And [declare you app dpi-aware](http://stackoverflow.com/a/13228495/17034) so you don't have to solve two problems at the same time. – Hans Passant Sep 02 '16 at 08:25
  • Thanks for the advice. The problem I'm facing is that it works good as long as I work only on a standard DPI computer but when I open the same project on my Lenovo Visual Studio starts messing around. Is there a way to tell VS it should not change settings/values? – Skuami Sep 05 '16 at 05:39

0 Answers0