将 Form 的 AutoScaleMode 属性设置为 Dpi:

解决Winform大多数DPI问题

在 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();
}

相关文章:

  • 2021-12-02
  • 2021-07-30
  • 2022-12-23
  • 2022-02-23
  • 2022-02-05
  • 2022-12-23
  • 2021-07-11
猜你喜欢
  • 2021-08-22
  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
  • 2021-06-07
  • 2022-12-23
  • 2022-02-20
相关资源
相似解决方案