设置crichedit的文字颜色和背景颜色
2013-01-31 13:45
155 查看
/* richedit文字颜色 */
::CHARFORMAT2 cf;
//memset(&cf,0, sizeof(cf));
m_EditLog.GetDefaultCharFormat(cf);
cf.crTextColor = RGB(255,255,0);
cf.dwMask = CFM_COLOR;
cf.dwEffects &= ~CFE_AUTOCOLOR;
::SendMessage(m_EditLog.m_hWnd,EM_SETCHARFORMAT,SCF_ALL,long(&cf));
// 或者m_EditLog.SetDefaultCharFormat(cf);
//m_EditLog.SetSelectionCharFormat(cf); //这句话是设置选中的颜色,不是默认字体颜色
/* richedit背景颜色 */
//m_EditLog.SetBackgroundColor(FALSE,0);
::CHARFORMAT2 cf;
//memset(&cf,0, sizeof(cf));
m_EditLog.GetDefaultCharFormat(cf);
cf.crTextColor = RGB(255,255,0);
cf.dwMask = CFM_COLOR;
cf.dwEffects &= ~CFE_AUTOCOLOR;
::SendMessage(m_EditLog.m_hWnd,EM_SETCHARFORMAT,SCF_ALL,long(&cf));
// 或者m_EditLog.SetDefaultCharFormat(cf);
//m_EditLog.SetSelectionCharFormat(cf); //这句话是设置选中的颜色,不是默认字体颜色
/* richedit背景颜色 */
//m_EditLog.SetBackgroundColor(FALSE,0);
相关文章推荐
- android--设置TextView部分文字的颜色和背景(高亮显示)
- android在代码中四种设置控件(以及TextView的文字颜色)背景颜色的方法
- 最新历史版本 :android--设置TextView部分文字的颜色和背景(高亮显示)
- IOS设置导航栏全局的背景图片、导航栏title文字颜色大小、导航栏左右按钮的颜色。
- android TextView 设置部分文字背景色和文字颜色
- android--设置TextView部分文字的颜色和背景(高亮显示)
- android在代码中四种设置控件(以及TextView的文字颜色)背景颜色的方法
- android 中TextView设置部分文字背景色和文字颜色
- 转 Android RadioButton设置选中时文字和背景颜色同时改变
- android--设置TextView部分文字的颜色和背景(高亮显示)
- 设置tablayout选中文字颜色和背景图片
- 如何设置richedit的默认背景色和文字颜色
- android TextView 设置部分文字背景色和文字颜色
- JLabel设置背景颜色和设置文字颜色
- android--设置TextView部分文字的颜色和背景(高亮显示)
- 设置tabBar的背景图片,选中文字颜色
- eclipse背景颜色及文字大小设置
- storyBoard设置textField的placeholder文字的背景颜色
- android TextView 设置部分文字背景色和文字颜色
- 计算背景图片的灰度值,设置文字的颜色