如何使用系统字体设置为Windows C#应用程序

编程入门 行业动态 更新时间:2024-10-26 16:34:35
本文介绍了如何使用系统字体设置为Windows C#应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

有关Windows应用程序(C#),是可以调整整个应用程序(包括所有形式)来使用系统字体设置大小,而不是使用固定大小?

For a windows application (C#), is it possible to adjust the entire application (including all forms) to use system font settings for size rather than using fixed sizes?

这是为视力受损的用户谁设置各自的机器上更大的字体大小。是否有可能为应用程序根据什么用户调整字体。

This is for users with visual impairment who have set a bigger font size on their machines. Is it possible for the application to adjust the font according to what the user has.

推荐答案

在你的形式构造(前调用的InitializeComponent()),我会尝试设置你的表格等于Font属性 System.Drawing.SystemFonts.DefaultFont 。如果您的控件(例如:文本框)不指定特定的字体那么我相信他们从父容器(即形式)继承其字体属性。

In the constructors of your forms (before calling InitializeComponent()), I would try setting the Font property of your forms equal to System.Drawing.SystemFonts.DefaultFont. If your controls (ex: textboxes) don't specify a specific font then I believe they inherit their font properties from their parent containers (i.e. forms).

在 System.Drawing.SystemFonts 类。您可能要调查这些进一步的为好。

There are other more specific system fonts (like the default setting for the Caption's font) in the System.Drawing.SystemFonts class. You may want to investigate those further as well.

更多推荐

如何使用系统字体设置为Windows C#应用程序

本文发布于:2023-11-11 10:56:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1578230.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:设置为   如何使用   应用程序   字体   系统

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!