继续前行...
接着前面的字符输入继续做,之前实现了鼠标左键点击,插入符从而出现,以及回车和退格功能;
1.设置字体
MFC中有CFont类来设置字体;
Construction
CFont | Constructs a CFont object. |
Initialization
CreateFontIndirect | Initializes a CFont object with the characteristics given in aLOGFONT structure. |
CreateFont | Initializes a CFont with the specified characteristics. |
CreatePointFont | Initializes a CFont with the specified height, measured in tenths of a point, and typeface. |
CreatePointFontIndirect | Same as CreateFontIndirect except that the font height is measured in tenths of a point rather than logical units. |
这次我们使用的是CreatePointFont函数;
BOOL CreatePointFont( intnPointSize, LPCTSTR lpszFaceName, CDC*pDC = NULL );
其中nPointSize是创建字体的高度,