Windows 缩放正在影响我的应用程序字体

Windows scale is affecting my application font

当我 运行 在 windows 设置中将其缩放为 100% 时,我的程序出现问题,应用程序在我设计时看起来不错。但是当比例设置为例如 125% 时。我遇到了图形问题,字体变大了。

我构建了具有不同 AutoscaleMode 值(None、字体和 DPI)的不同二进制文件。然后,我以 100% 和 120% 的比例启动它们(每次我注销以应用比例)。

这里是不同案例的截图(在文本框中我写了使用的比例):

我正在为组件使用 MetroFramework。
源代码可用 here(最后一次提交)。
如何修复我的应用程序,使其在不同比例 windows 设置下看起来相同?

我使用了 SetProcessDPIAware,它解决了这个问题,现在应用程序可以在不同的比例模式下工作,只有组合框大小发生变化的问题。我发现已经在 git here 上为组合框打开了一张票。

static class Program
{
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    [STAThread]
    static void Main()
    {
        SetProcessDPIAware();
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        Application.Run(new Form1());
    }

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