2012-04-16 78 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; 

現在,您已將文本分配給普通字體。我希望我能幫上忙。