2012-03-29 45 views
5

如何調整 「字體」 爲以下幾點:(解決)如何更改CEdit的「字體」?

fontSize 40 
BOLD 
Italicized 

感謝


下失敗:(現在工作)

CFont *myFont = new CFont(); 
myFont->CreateFont(40, 0, 0, 0, FW_HEAVY, true, false, 
     0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, 
     FIXED_PITCH|FF_MODERN, _T("Courier New")); 

CEdit *ed1 = new CEdit(); 
ed1->Create(WS_VISIBLE | WS_BORDER,CRect(200,100,500,140),this,16); 
ed1->SetFont(myFont); 

回答

5

一定不要delete myFont只要你的編輯控制仍在。