简体   繁体   English

更改Windows窗体应用程序中的字体大小

[英]Change font size in a Windows Forms application

Here below: 在这下面:

My Windows Forms application have functionality to change language, but my problem is that when my application in English fonts look much finer than in Hindi fonts. 我的Windows窗体应用程序具有更改语言的功能,但我的问题是,当我的英文字体应用程序看起来比印地语字体更精细。

Below is the screen shot of my application in both the Hindi and English language. 以下是我的应用程序的印地语和英语语言的屏幕截图。

Hindi Font 印地语字体

印地语

English Font 英文字体

英语

No, you can not change the font size within a MessageBox. 不,您无法更改MessageBox中的字体大小。 The MessageBox font size is defined by the user's operating system. MessageBox字体大小由用户的操作系统定义。

The only way you can do this, is by creating your own custom Message Box: 您可以这样做的唯一方法是创建自己的自定义消息框:

How To Make a Custom Message Box 如何制作自定义消息框

To change the Windows Forms form font, just use the Form's Font Property : 要更改Windows窗体表单字体,只需使用窗体的字体属性

public partial class MainForm : Form
{
    public MainForm()
    {
        InitializeComponent();
        this.Font = new System.Drawing.Font(
                      "Microsoft Sans Serif",
                      24F,
                      System.Drawing.FontStyle.Regular,
                      System.Drawing.GraphicsUnit.Point,
                      ((byte)(0)));
    }
}

Replace "24F" with the desired font size. 将“24F”替换为所需的字体大小。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Windows Forms应用程序中更改所有屏幕的字体大小 - How can I change the font size of all the screens in a windows forms application Windows Forms C# 应用程序 - 当用户为操作系统字体大小选择 125% 或 150% 时,设置表单控件的字体大小以适应屏幕? - Windows Forms C# application - Set font size of form controls to fit the screen when a user choose 125% or 150% for the OS font size? 即使整个Windows文本大小从“小”更改为“中”后,如何保持Windows窗体应用程序的默认字体大小? - How to maintain the default font size of Windows Forms application even after the entire Windows Text size is changed from Small to Medium? 在窗体中动态更改标签的字体 - Dynamically change font of a label in windows forms 如何在 C# Windows 窗体应用程序中修复窗体大小而不让用户更改其大小? - How can I fix the form size in a C# Windows Forms application and not to let user change its size? 更改应用程序的默认字体 Xamarin Forms - Change default font of the application Xamarin Forms C#和Windows Forms应用程序表单大小 - C# and Windows Forms application form size 当用户选择125%或150%的OS字体大小时,如何强制Windows窗体C#应用程序忽略? - How do I force a Windows Forms C# application to ignore when a user choose 125% or 150% for the OS font size? 在 Windows 8.1 应用程序中更改全局应用程序字体 - Change global application font in a Windows 8.1 app 无法更改列表视图xamarin.forms中的字体大小 - can't change font size in listview xamarin.forms
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM