embed ttf as embeded resource can't reference it

Posted by HoNgOuRu on Stack Overflow See other posts from Stack Overflow or by HoNgOuRu
Published on 2010-03-28T22:58:55Z Indexed on 2010/03/28 23:03 UTC
Read the original article Hit count: 370

Filed under:
|
|

Hi, I've just added a ttf file to the project (c# 2008 express) as "file" and build option to embeded resource.

I'm having problems when trying to set this font like this: (I know the next line is wrong...) this.label1.Font = AlarmWatch.Properties.Resources.Baby_Universe;

Error 1 Cannot implicitly convert type 'byte[]' to 'System.Drawing.Font' C:\Users\hongo\Documents\Visual Studio 2008\Projects\AlarmWatch\AlarmWatch\Form1.Designer.cs 57 32 AlarmWatch

I know it is byte[] cause I've set the option build as embeded resource, but...comparing with this line that is correct

"this.label1.Font = new System.Drawing.Font("OCR A Extended", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));"

How can I set this.label1 to use the new font??? thanks

© Stack Overflow or respective owner

Related posts about c#

Related posts about resource