如何设置按钮字体为Marlett [英] How do I set button font to Marlett
问题描述
我试图按键的字体设置为系统的Marlett字体。不过,虽然我手动设置字体面,使用其他字体。此外,Marlett没有上市,当我使用的字体对话框,选择该按钮的字体。
I'm attempting to set a font of button to system's Marlett font. However, though I manually set the font-face, other font is used. Also, Marlett is not listed, when I use the font dialog to choose a font for that button.
为什么会这样呢?我能做些什么来使用Marlett字体在.NET Windows窗体控件?
Why is it so? What can I do to use Marlett font in .NET Windows Forms controls?
推荐答案
虽然我不知道是什么code是设计师的背后,我一直发现,自定义安装的字体的不显示起来的设计师。好消息是,字体
属性是环境,所以如果你想所有的控件具有相同的字体
你会< STRONG>仅已在表格
进行设定。但是,好像你只是想一个控件具有字体
让我们做到这一点:
Though I do not know what code is behind the designer, I have always found that custom installed fonts do not show up in the designer. The good news is that the Font
property is ambient so if you wanted all controls to have the same Font
you would only have to set it at the Form
. However, it seems like you just want one control to have the Font
so let's do this:
ctrl.Font = new Font("Marlett", 8.5f);
这将设置该控件的字体
到 Marlett
和大小 8.5
例如
如果你想整组控制的具有相同字体
,如果他们可以放在像面板容器
,然后你只需要设置字体
的面板
;因为再次,它是一个环境属性。
If you wanted an entire set of controls to have the same Font
, if they can be placed in a container like a Panel
, then you would only have to set the Font
of the Panel
; because again, it's an ambient property.
这篇关于如何设置按钮字体为Marlett的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!