pEView->GetRichEditCtrl().SetWindowText(EchoStr);
我用这种方法往view里写东西,我怎么才能设置我现在要写的字符的字体和字号呢?
我一直在线!问题解决,立即给分!
我用这种方法往view里写东西,我怎么才能设置我现在要写的字符的字体和字号呢?
我一直在线!问题解决,立即给分!
解决方案 »
- MessageBox 参数问题
- 救急!救急!!救急!!!VC按钮的一个修改代码
- 关于extern 变量的灵异问题
- 关于字符串 \ ' 的问题?
- 一家大型软件公司某高级领导撰写的宣言,搞笑的很,就象搞文化大革命啊,给大家找个乐
- 可设定颜色的滚动条控件,可设定滚动条颜色,支持水平和垂直
- 请问大虾,为什么资源编辑器中修改LISTBOX的border风格有立体效果,而我在程序中建的ListBox加上WS_BORDER风格或修改加上这个风格都是平
- 使用winInet类如何设置超时?
- 请教:VC6下,响应Com组件回调函数的问题
- 急,一个关于电子表格的问题。
- 帮助文件问题,在线等
- 8139网卡和8029网卡连不起来,一切设置都对,为何?
设一个新的字体
{
CRichEditView::OnInitialUpdate(); CFontDialog dlg;
if(dlg.DoModal()==IDOK)
{
LOGFONT lf;
dlg.GetCurrentFont(&lf);
m_font.CreateFontIndirect(&lf);
this->SetFont(&font);
}
//m_font是视图的成员变量,可以用m_font.CreateFont(...)来创建
// Set the printing margins (720 twips = 1/2 inch).
SetMargins(CRect(720, 720, 720, 720));
}
{
CRichEditView::OnInitialUpdate(); // Set the printing margins (720 twips = 1/2 inch).
SetMargins(CRect(720, 720, 720, 720));
//////////////////////////////////////////////////////
CHARFORMAT2 cf;
memset (&cf, '\0', sizeof (CHARFORMAT2));
cf.cbSize = sizeof (CHARFORMAT2);
GetRichEditCtrl().GetDefaultCharFormat (cf);
cf.dwMask = CFM_FACE | \
CFM_SIZE | \
CFM_UNDERLINE | \
CFM_COLOR | \
CFM_BOLD;
cf.yHeight = 12 * 20; // 12 points in twips
cf.dwEffects &= ~(CFE_AUTOCOLOR | CFE_BOLD);
cf.crTextColor = RGB(0x00, 0x00, 0x00);
strcpy (cf.szFaceName, "Times New Roman");
GetRichEditCtrl().SetDefaultCharFormat (cf);
long lEventMask = GetRichEditCtrl().GetEventMask();
lEventMask |= ENM_SELCHANGE;
GetRichEditCtrl().SetEventMask(lEventMask);}