2010-11-28 35 views

回答

6

我认为你需要这样的:

// Be sure to dispose your PrivateFontCollection 
// and Font to avoid an easy leak! 
System.Drawing.Text.PrivateFontCollection privateFonts = new PrivateFontCollection(); 
privateFonts.AddFontFile("c:\myapplication\mycustomfont.ttf"); 
System.Drawing.Font font = new Font(privateFonts.Families[0], 12); 
this.textBox1.Font = font;