MFC RichEdit
2017-07-24 19:24
267 查看
MFC RichEdit
flyfish
资源窗体 增加Rich Edit 2.0 Control
初始化
头文件内容
//控件绑定变量
CRichEditCtrl m_RichEdit_ctlContent;
//格式
CHARFORMAT2 cf;
实现文件内容
dwMask
Specifies the character height, in twips (1/1440 of an inch, or 1/20 of a printer’s point). To use this member, set the CFM_SIZE flag in the dwMask member.
指定的字符高度,单位为缇(1 / 1440英寸,或1 / 20的打印机的点)。使用此成员,在dwmask成员中设置cfm_size标志
1 twip=1/1440 inch
1 twip=1/20 point
pint与word字体号的对照
96 px/in screens
以二号字体为例 查表是22Point = 二号
设置数值是22*20=440
flyfish
资源窗体 增加Rich Edit 2.0 Control
初始化
BOOL CMFCApplicationApp::InitInstance() { //TODO: call AfxInitRichEdit2() to initialize richedit2 library. AfxInitRichEdit2(); }
头文件内容
//控件绑定变量
CRichEditCtrl m_RichEdit_ctlContent;
//格式
CHARFORMAT2 cf;
实现文件内容
m_RichEdit_ctlContent.SetWindowText(L"富文本测试1234567"); cf.cbSize = sizeof(CHARFORMAT2); cf.dwMask = CFM_BACKCOLOR | CFM_COLOR | CFM_FACE | CFM_SIZE; // cf.crBackColor = RGB(0, 255, 0); // 背景色 cf.crTextColor = RGB(255, 0, 0); //文字颜色 cf.yHeight = 440; lstrcpynW(cf.szFaceName, _T("微软雅黑"),32); m_RichEdit_ctlContent.SetSel(1, 5); // 选中区域文字 m_RichEdit_ctlContent.SetSelectionCharFormat(cf);
dwMask
Specifies the character height, in twips (1/1440 of an inch, or 1/20 of a printer’s point). To use this member, set the CFM_SIZE flag in the dwMask member.
指定的字符高度,单位为缇(1 / 1440英寸,或1 / 20的打印机的点)。使用此成员,在dwmask成员中设置cfm_size标志
1 twip=1/1440 inch
1 twip=1/20 point
pint与word字体号的对照
96 px/in screens
以二号字体为例 查表是22Point = 二号
设置数值是22*20=440
相关文章推荐
- [MFC]RichEdit响应回车换行,自动水平/垂直滚动
- MFC RichEdit的使用
- MFC RichEdit使用
- 在对话框类MFC程序中使用RichEdit
- MFC RichEdit的用法
- MFC 实现richedit右键菜单的复制粘贴功能
- MFC RichEdit的用法汇总
- MFC 控件richedit
- MFC:RichEdit and CFindReplaceDialog
- MFC应用---超链接RichEdit
- mfc richedit 自动换行
- Fucked MFC RichEdit In Visual c++2010!
- mfc richedit 自动换行设置
- VC/MFC中使用RichEdit 要注意的地方
- VC/MFC中使用RichEdit 要注意的地方
- MFC Richedit隐藏光标
- MFC应用---超链接RichEdit
- MFC RICHEDIT设置等宽字体
- RichEdit中插入GIF动画(使用QQ的ImageOle.dll)
- RichEdit 小结