Control Location in Windows form and DPI settings on the monitor

G

Guest

Hi,

I am trying to move controls around in a form based on user selection on a
combo-box. So i hard coded the location and distances of where and how much
to move controls by in my program. Everything works fine on my machine. But
when i run my program on another machine which has a diferent DPI setting on
the monitor(mine was 120 and the other machine was 96) the control position
and the distances were bad. I am assuming that it because when i move a
control down by a given distance (100) to a certain location, the distance
evaluates to be a different location on the other computer with different DPI
setting. I know some people used to have similar problems in VB6 but i
thought microsoft fixed it in .NET. How do i make my form appear uniform on
both computers with different DPI settings? I would appreciate any help or
suggestions in this regard.

Thank You,
Vish
 
S

Stoitcho Goutsev \(100\)

Vish,

By default the DPI is 96. I guess the problem you having is because the form
has its AutoScale proeprty set to true. This makes the form to to adjust
based on the used font. The size of the font letters are affected by the DPI
settings so I guees that's why you get different result. Usually this is not
a problem, but mybe in your case it is.

Try to turn off this property.
 
G

Guest

Hi Goutsev,

I appreciate your suggestions. That was not the problem in my case. I tried
setting the AutoScale property of the form to "None" but that did not fix the
problem. Any other ideas to try and fix the problem would be wonderful?

-Vish
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top