请高手帮忙!

leolyq 2004-04-06 12:29:26
怎么样再edit控件里面输入彩色字?
...全文
3 点赞 收藏 7
写回复
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
BinaryTreeEx 2004-04-06
用RichEdit试试,乱说的,可以不用给分。
回复
leolyq 2004-04-06
哪里又具体的例子麽?
回复
Pipi0714 2004-04-06
重载CEdit有可能解决问题。
回复
ray88 2004-04-06
http://www.codeproject.com/staticctrl/coloredit_colorstatic.asp?target=edit
回复
leolyq 2004-04-06
up
回复
bhut 2004-04-06
改变对话框对象颜色与字体颜色

HBRUSH CTerminalDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);

// TODO: Change any attributes of the DC here

// TODO: Return a different brush if the default is not desired
if ((pWnd->GetDlgCtrlID() == IDC_STATIC1)||(pWnd->GetDlgCtrlID() == IDC_STATIC2)
||(pWnd->GetDlgCtrlID() == IDC_STATIC3)||(pWnd->GetDlgCtrlID() == IDC_CHECK1))
{
pDC->SetTextColor(RGB(255, 155, 0));
// pDC->SetBkColor(bkcolor);
// pDC->SetBkMode(OPAQUE);
pDC->SetBkMode(TRANSPARENT);
return (HBRUSH) m_brush .GetSafeHandle ( );
}
return hbr;
}
回复
你可以自己CreateFont啊
HFONT CreateFont(
int nHeight, // height of font
int nWidth, // average character width
int nEscapement, // angle of escapement
int nOrientation, // base-line orientation angle
int fnWeight, // font weight
DWORD fdwItalic, // italic attribute option
DWORD fdwUnderline, // underline attribute option
DWORD fdwStrikeOut, // strikeout attribute option
DWORD fdwCharSet, // character set identifier
DWORD fdwOutputPrecision, // output precision
DWORD fdwClipPrecision, // clipping precision
DWORD fdwQuality, // output quality
DWORD fdwPitchAndFamily, // pitch and family
LPCTSTR lpszFace // typeface name
);

HFONT CreateFontIndirect(
CONST LOGFONT* lplf // characteristics
);
回复
发动态
发帖子
VC/MFC
创建于2007-09-28

1.5w+

社区成员

VC/MFC相关问题讨论
申请成为版主
社区公告
暂无公告