2 ld login LD_login 于 2013.11.21 15:26 提问

MFC 想对已有的Edit大号文字显示部分被截断是什么原因

HBRUSH CEditCtrl::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CWnd::OnCtlColor(pDC, pWnd, nCtlColor);
if (pWnd == m_pEdit)
{
HBRUSH newHbr = CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
pDC->SetTextColor(m_color);

pDC->SetBkColor(RGB(0,0,0));

pDC->SelectObject(m_pFont);

return newHbr;
}
return hbr;
}

int CEditCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CWnd::OnCreate(lpCreateStruct) == -1)
return -1;
m_pFont->CreateFontW(
m_nFontHeigth, // nHeight
m_nFontWidth, // nWidth
0, // nEscapement
0, // nOrientation
m_nFontWeight, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
m_lpszFacename); // lpszFacename

return 0;

}

Csdn user default icon
上传中...
上传图片
插入图片