简体   繁体   English

如何在 C# windows 应用程序中更改 Metro 文本框的字体系列?

[英]How to change font family for metro textbox in C# windows application?

I am using metro textbox and metro combo box in my windows application.我在我的 Windows 应用程序metro combo box使用metro textboxmetro combo box When running the application, the font family of metro textbox and metro combo box looks different.运行应用程序时, metro textboxmetro combo box的字体系列看起来不同。 But I want to change all control font family to "ARIAL".但我想将所有控件字体系列更改为“ARIAL”。

Any suggestions or Reference?有什么建议或参考吗?

if you want to change only the Font Family to Arial to ALL CONTROLS, this could help (you could do this in Load ou Shown events:如果您只想将字体系列更改为 Arial 到所有控件,这可能会有所帮助(您可以在 Load ou Shown 事件中执行此操作:

private void Form1_Shown(object sender, EventArgs e)
{
     ChangeFontFamily(this);
}

private void ChangeFontFamily(Form _form)
{
     for (int i = 0; i < _form.Controls.Count; i++)
     {
         _form.Controls[i].Font = new Font("Arial", _form.Controls[i].Font.Size, _form.Controls[i].Font.Style);
      }
}

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

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