如何将项目字体更改为自定义字体? [英] How Do I Change Project Font To Custom Font ?

查看:126
本文介绍了如何将项目字体更改为自定义字体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在visual studio 2013中使用c#实现了一个桌面应用程序。

但是它有一个问题,我想将项目字体更改为自定义字体,例如所有控件字体。 />
请帮帮我

解决方案

试试这些链接 -

加载并使用自定义字体而不安装它[ ^ ]

Windows窗体中的Cusomt字体 [ ^ ]


您需要使用控件可以从父级继承字体的事实。您不应单独设置所有字体;它不是一种可维护的做事方式。从图形设计的角度来看,拥有一致的字体也很重要;在整个应用程序中应该只有很少(比方说,1-3)不同的字体。如果使用正确的样式,更改字体将不会有问题。



此外,使用Forms,所有字体都在C#文件中规定,找不到问题他们都使用VS,或创建一个简单的文本搜索(和替换实用程序)。同样,如果项目以可维护的方式编写,通常不需要。



最后(仅供记录,不作为实用建议),您可以顺利更改运行时的字体。它足以递归遍历所有控件,从父级(最上面是一个表单)到所有孩子,并根据一些标准修改一些字体。



-SA

i was implementing a desktop app with c# in visual studio 2013 .
but there is a problem with it that i want to change project font for example all controls font to a custom font.
please help me

解决方案

Try these links -
Load And Use Custom Font Without Installing It[^]
Cusomt fonts in Windows Forms[^]


You need to use the fact the the controls can inherit fonts from the parent. You should not set all font individually; it is not a maintainable way of doing things. From the graphical design point of view, having consistent fonts is also very important; there should be very few (say, 1-3) different fonts in the whole application. If you use right styling, changing fonts won't be a problem.

Besides, with Forms, all fonts are prescribed in C# files, it's not a problem to find them all using VS, or create a simple text search (and replace utility). Again, if the project is written in maintainable way, it is usually not needed.

Finally (just for record, not as a practical advice), you can smoothly change fonts during runtime. It's enough to recursively traverse all controls from parent (which is, on top, is a form) to all children and modify some fonts based on some criteria.

—SA


这篇关于如何将项目字体更改为自定义字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆