如何更改Window窗体的FontFamily?
即使我已经设置了这些属性,我也无法更改窗口窗体标题的 fontfamily 或 fontstyle。默认的 fontfamily 是 MS UI Gothic,我想更改为 meiryo。在 XML 文件中,看起来不错,但在运行时没有任何更改。
<Window x:Class="TestFont.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="130" Width="369" FontFamily="meiryo" FontStyle="Italic">
</Window>
I cannot change fontfamily or fontstyle for title of Window Form even though I have already set these properties.The default fontfamily is MS UI Gothic and I want change to meiryo.At XML file, It seems ok but It doesnt have any changes at runtime.
<Window x:Class="TestFont.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="130" Width="369" FontFamily="meiryo" FontStyle="Italic">
</Window>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
窗口标题是窗口非客户端区域的一部分,并不是由 WPF 真正呈现的。更改该字体的唯一方法是修改显示属性(Windows 范围的设置)。
The window caption is part of the non-client area of the window is not really rendered by WPF. The only way you can change that font is by modifying your display properties (a Windows-wide setting).
您无法更改标题文本的外观。它由使用的主题、个人设置等决定,因此根据用户的喜好,每台计算机上的设置都不同。
You can not change the look of the title text. It's decided by theme used, personal settings etc. so it's different on every computer according to the users liking.