I understand that in WPF the font size used by a control is determined by the parent control, unless an override is defined.Given that I don't define a font-size anywhere in my application, I assume that the default font-size is that configured for the top-level Window.Is this value determined by the system the application is running on (and if so where?); or is it determined by some built-in WPF default value (and if so what is it?) 解决方案 The default font size is determined by the FontSize dependency property of the TextElement class: https://referencesource.microsoft.com/#PresentationFramework/src/Framework/System/Windows/Documents/TextElement.cs,e28640b48d79de57. It defaults to SystemFonts.MessageFontSize which has a default value of 12.The Control base class them adds itself as an owner of this dependency property and defines its own FontSize property that can any control can set to a custom value.Please refer to the following blog post for more information about this: https://blog.davidpadbury.com/2008/08/30/change-the-default-font-of-a-wpf-application/. 这篇关于如何确定WPF窗口的默认字体大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-31 00:02