The forms are cut for me using high resolution on WinForm

GMS 1 Reputation point
2020-09-18T15:07:33.7+00:00

I got a new laptop with very high resolution. I increased the size text, apps and other to 150%

i work on WinForm program using Visual-Studio 2019.

All the forms in my program are cut and everything goes wrong on the screen.

i try this:

app.manifest

<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">  
    <application>  
      <!-- Windows 10 compatibility -->  
      <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />  
    </application>  
  </compatibility>  

app.config

<System.Windows.Forms.ApplicationConfigurationSection>  
    <add key="DpiAwareness" value="PerMonitorV2" />  
    <add key="EnableWindowsFormsHighDpiAutoResizing" value="false" />  
  </System.Windows.Forms.ApplicationConfigurationSectio  

n>
i work on .NET Framework 4.7.2

i also try this:

https://learn.microsoft.com/en-us/dotnet/desktop/winforms/high-dpi-support-in-windows-forms?view=netframeworkdesktop-4.8

and also this on the main of every form: (Each time something different)

this.AutoScaleMode = AutoScaleMode.Font;  
this.AutoScaleMode = AutoScaleMode.Dpi;  
this.AutoScaleMode = AutoScaleMode.None;  

I have already tried everything .... and nothing helps. any idea ?

thanks

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,860 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Daniel Zhang-MSFT 9,621 Reputation points
    2020-09-21T08:18:22.273+00:00

    Hi GMS
    To enable per-monitor DPI awareness in the app.config file, you just add the following to your application configuration file.

    <System.Windows.Forms.ApplicationConfigurationSection>  
      <add key="DpiAwareness" value="PerMonitorV2" />  
    </System.Windows.Forms.ApplicationConfigurationSection>  
    

    >>All the forms in my program are cut and everything goes wrong on the screen.
    Please provide more information or some related code to reproduce the situation.
    Best Regards,
    Daniel Zhang


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments