2012-04-16 76 views

回答

64

也许是这样的:

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

5

这应该这样做(黑体为好);

label1.Font = new Font("Serif", 24,FontStyle.Bold); 
7

使用这一个只改变字体大小不是字体的名称

label1.Font = new System.Drawing.Font(label1.Font.Name, 24F); 
0

您也可以创建一个变量,然后将其分配给一个文本。这很酷,因为你可以分配两个或更多的文本。

要指定一个变量做

public partial class Sayfa1 : Form 

    Font Normal = new Font("Segoe UI", 9, FontStyle.Bold); 

    public Sayfa1() 

这varible没有分配到任何文本yet.To做到这一点写入文本的名称(看proporties - >(名称)),然后写“ .Font“,然后调用你的字体变量的名字。

lupusToolStripMenuItem.Font = Normal; 

现在,您已将文本分配给普通字体。我希望我能帮上忙。