1. 将 Form 的 AutoScaleMode 属性设置为 DPI;

2. 在Program.cs中修改代码

class Program
{
    [STAThread]
    static void Main()
    {
        if (Environment.OSVersion.Version.Major >= 6)
            SetProcessDPIAware();

        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        Application.Run(new Form1());
    }

    [System.Runtime.InteropServices.DllImport("user32.dll")]
    private static extern bool SetProcessDPIAware();
}

zz from: https://www.cnblogs.com/jizhiqiliao/p/10001181.html

相关文章:

  • 2022-12-23
  • 2021-10-16
  • 2022-12-23
  • 2021-08-22
  • 2021-11-06
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-21
  • 2022-12-23
  • 2022-12-23
  • 2021-10-12
  • 2021-10-14
  • 2021-12-16
  • 2021-05-21
相关资源
相似解决方案