简体   繁体   中英

Form is zoomed in on some computers

Some people that use my program have a like zoomed in form. Has this anything todo with the .NET version they have or what's the problem. They don't have the same screen resolution.

在此处输入图片说明

让用户将其浏览器缩放到100%可能大于100%,因此可能是问题的原因。

This definitely seems like a result of DPI awareness (available since Windows Vista).

The right thing to do is to make your app "fluid" and properly format itself for bigger content.

The easy way out is to disable DPI awareness. Your app will still be bigger, but it will be scaled as a whole instead of having every independent component scale by itself.

You can do so by adding the following in your app.manifest file:

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
 ...
  <asmv3:application>
    <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
      <dpiAware>false</dpiAware>
    </asmv3:windowsSettings>
  </asmv3:application>
 ...
</assembly>

The version of .NET should make no difference. The version of windows probably does, and also things like settings for high DPI screens, as blogged by Scott Hanselman

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM