这是用C#更改字体大小的最简单方法。最简单的方法来更改字体和字体大小
与java它可以通过调用具有必要参数的Font构造函数来轻松完成。
JLabel lab = new JLabel("Font Bold at 24");
lab.setFont(new Font("Serif", Font.BOLD, 24));
这是用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
这应该这样做(黑体为好);
label1.Font = new Font("Serif", 24,FontStyle.Bold);
使用Font Class来设置控件的字体和样式。
尝试Font Constructor (String, Single)
Label lab = new Label();
lab.Text ="Font Bold at 24";
lab.Font = new Font("Arial", 20);
或
lab.Font = new Font(FontFamily.GenericSansSerif,
12.0F, FontStyle.Bold);
要获得安装的字体是指本 - .NET System.Drawing.Font - Get Available Sizes and Styles
使用这一个只改变字体大小不是字体的名称
label1.Font = new System.Drawing.Font(label1.Font.Name, 24F);
您也可以创建一个变量,然后将其分配给一个文本。这很酷,因为你可以分配两个或更多的文本。
要指定一个变量做
public partial class Sayfa1 : Form
Font Normal = new Font("Segoe UI", 9, FontStyle.Bold);
public Sayfa1()
这varible没有分配到任何文本yet.To做到这一点写入文本的名称(看proporties - >(名称)),然后写“ .Font“,然后调用你的字体变量的名字。
lupusToolStripMenuItem.Font = Normal;
现在,您已将文本分配给普通字体。我希望我能帮上忙。