我有這樣的代碼。C#將顏色應用於字體
System.Drawing.Color col = System.Drawing.ColorTranslator.FromHtml("#101B83");
System.Drawing.Font nameFont = new System.Drawing.Font("Tahoma", 10);
System.Drawing.Font birthdayFont = new System.Drawing.Font("Tahoma", 6);
System.Drawing.SolidBrush drawBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Black);
nameFont.Color = col;
最後一行不起作用,因爲無法找到.Color字段。爲什麼?
你有沒有聽說過'namespaces'? – Mike 2010-10-19 09:00:07