Csharp/C#教程:如何使用Windows C#应用程序的系统字体设置分享


如何使用Windows C#应用程序的系统字体设置

对于Windows应用程序(C#),是否可以调整整个应用程序(包括所有表单)以使用系统字体设置大小而不是使用固定大小?

这适用于视力受损的用户,他们在自己的机器上设置了更大的字体。 应用程序是否可以根据用户的具体情况调整字体。

如果希望应用程序按系统字体缩放,则应将所有表单的AutoScaleMode属性设置为值AutoScaleMode.Font如果希望通过Windows DPI设置缩放,则应将AutoScaleMode设置为AutoScaleMode

在这里您可以找到更多信息 – https://msdn.microsoft.com/en-us/library/ms229605.aspx

上述就是C#学习教程:如何使用Windows C#应用程序的系统字体设置分享的全部内容,如果对大家有所用处且需要了解更多关于C#学习教程,希望大家多多关注—计算机技术网(www.ctvol.com)!

 // Get dpi width float x = this.CreateGraphics().DpiX; // if screen is width if (x == 120) // Get big image from Resources this.BackgroundImage = Properties.Resources.BigImage; else if (x==96) { // Get small image from Resources this.BackgroundImage = Properties.Resources.loading49; this.BackColor = ColorTranslator.FromHtml("#E6E6E6"); this.button2.Size = new Size(85, 30); this.button1.Size = new Size(75, 24); this.textBox1.Size = new Size(150, 40); } 

本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/cdevelopment/1020401.html

(0)
上一篇 2022年1月5日
下一篇 2022年1月5日

精彩推荐