![](/img/trans.png)
[英]How to change font style and font weight programmatically using c# in metro app for windows 8.1
[英]How to change font family for metro textbox in C# windows application?
我在我的 Windows 应用程序metro combo box
使用metro textbox
和metro combo box
。 运行应用程序时, metro textbox
和metro combo box
的字体系列看起来不同。 但我想将所有控件字体系列更改为“ARIAL”。
有什么建议或参考吗?
如果您只想将字体系列更改为 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.