gpt4 book ai didi

c# - 更改字体和字体大小的最简单方法

转载 作者:IT王子 更新时间:2023-10-29 03:52:15 25 4
gpt4 key购买 nike

这是使用 C# 更改字体大小的最简单方法。

使用 java,这一切都可以通过使用必要的参数调用 Font 构造函数来轻松完成。

JLabel lab  = new JLabel("Font Bold at 24");
lab.setFont(new Font("Serif", Font.BOLD, 24));

最佳答案

也许是这样的:

yourformName.YourLabel.Font = new Font("Arial", 24,FontStyle.Bold);

或者,如果您与表单属于同一类,则只需执行以下操作:

YourLabel.Font = new Font("Arial", 24,FontStyle.Bold);

构造函数采用不同的参数(所以选择你的毒药)。像这样:

Font(Font, FontStyle)   
Font(FontFamily, Single)
Font(String, Single)
Font(FontFamily, Single, FontStyle)
Font(FontFamily, Single, GraphicsUnit)
Font(String, Single, FontStyle)
Font(String, Single, GraphicsUnit)
Font(FontFamily, Single, FontStyle, GraphicsUnit)
Font(String, Single, FontStyle, GraphicsUnit)
Font(FontFamily, Single, FontStyle, GraphicsUnit, Byte)
Font(String, Single, FontStyle, GraphicsUnit, Byte)
Font(FontFamily, Single, FontStyle, GraphicsUnit, Byte, Boolean)
Font(String, Single, FontStyle, GraphicsUnit, Byte, Boolean)

引用 here

关于c# - 更改字体和字体大小的最简单方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10173147/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com