简体   繁体   English

更改winforms应用程序的字体系列和大小

[英]Changing the font family and size for a winforms app

The default font family and size for Winform apps are just too small (and look so outdated IMHO). Winform应用程序的默认字体系列和大小太小(看起来已经过时了恕我直言)。

Is there any easy way I could change them for the whole application? 有没有简单的方法可以为整个应用程序更改它们? I'd prefer not to set them on a control or form basis -just a one time thing, if possible. 我宁愿不在控件或表单的基础上设置它们 - 如果可能的话,只是一次性的事情。

WindowsFormsApplication1.Properties.Settings.Default.UserFont = new Font("Arial", 24, FontStyle.Bold);

您可以在应用程序中设置表单的Font属性,这将更改具有相同字体的所有子控件。

Short answer : no. 简答:不。 But you can workaround this. 但你可以解决这个问题。

Make yourself a BaseForm that is empty and sets it's font to the one you want. 让自己成为一个空的BaseForm并将它的字体设置为你想要的字体。 Then you need to make every other form to inherits your base one. 然后你需要让所有其他形式继承你的基础形式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM