小弟我将EDIT控件做成如下的背景,可是在EDIT输入时,以前的文字不消失,请教因该如何样做

我将EDIT控件做成如下的背景,可是在EDIT输入时,以前的文字不消失,请问因该怎么样做?
我将EDIT控件做成如下的背景,可是在EDIT输入时,在EDIT里的以前文字不消失,重新输入就叠加了,请问因该怎么样解决?

BOOL CTabDlg5::OnEraseBkgnd(CDC* pDC) 
{
CDialog::OnEraseBkgnd(pDC);
HBITMAP   m_hBitmap;
HDC           m_hBkDC;
m_hBitmap   =   ::LoadBitmap(::GetModuleHandle(NULL),MAKEINTRESOURCE(IDB_WATCH2));
m_hBkDC     =   ::CreateCompatibleDC(pDC-> m_hDC);
if(m_hBitmap   &&   m_hBkDC)
{
::SelectObject(m_hBkDC,m_hBitmap);
::StretchBlt(pDC-> m_hDC,0,0,700,610,m_hBkDC,0,0,700,610,SRCCOPY);
::DeleteObject(m_hBitmap);
::DeleteDC(m_hBkDC);
}
return TRUE;
}



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

pDC->SetBkMode(TRANSPARENT);//设置背景透明
pDC->SetTextColor(RGB(255,255,0));//设置字体为黄色
return (HBRUSH)::GetStockObject(NULL_BRUSH);
return hbr;
}
------解决思路----------------------
编辑框的自绘控制, 应该是响应WM_CTLCOLOREDIT,WM_CTLCOLORSTATIC
在这个响应里绘制你想要的东西, 然后返回一个背景画刷,  

然后OnEraseBkgnd仅仅返回TRUE即可, 不用管了.

HBRUSH  CMyEdit::OnCtlColor(HDC hdc)
{   
Draw(FALSE); //自定义的绘制函数, 函数内部也仅是绘制背景,  文字还是交给系统自己绘制.

SetBkMode(hdc,TRANSPARENT);   //背景透明
//设置字体颜色
::SetTextColor(hdc,CDDBPaintHelper::ARGB_TO_COLORREF(m_titleTextColor[m_state]));  

return   m_hBkgBrush;//(HBRUSH)GetStockObject(HOLLOW_BRUSH);
}
------解决思路----------------------
OnEraseBkgnd里直接return TRUE; OnPaint函数中绘制图形。
------解决思路----------------------
不一定对,仅供参考:
CWnd::OnEraseBkgnd  
afx_msg BOOL OnEraseBkgnd( CDC* pDC );

Return Value

Nonzero if it erases the background; otherwise 0.

Parameters

pDC

Specifies the device-context object.

Remarks

The framework calls this member function when the CWnd object background needs erasing (for example, when resized). It is called to prepare an invalidated region for painting.

The default implementation erases the background using the window class background brush specified by the hbrBackground member of the window class structure. 

If the hbrBackground member is NULL, your overridden version of OnEraseBkgnd should erase the background color. Your version should also align the origin of the intended brush with the CWnd coordinates by first callingUnrealizeObject for the brush, and then selecting the brush.

An overridden OnEraseBkgnd should return nonzero in response to WM_ERASEBKGND if it processes the message and erases the background; this indicates that no further erasing is required. If it returns 0, the window will remain marked as needing to be erased. (Typically, this means that the fErase member of the PAINTSTRUCT structure will be TRUE.) 

Windows assumes the background is computed with the MM_TEXT mapping mode. If the device context is using any other mapping mode, the area erased may not be within the visible part of the client area.

Note   This member function is called by the framework to allow your application to handle a Windows message. The parameters passed to your function reflect the parameters received by the framework when the message was received. If you call the base-class implementation of this function, that implementation will use the parameters originally passed with the message and not the parameters you supply to the function.

CWnd Overview 
------解决思路----------------------
  Class Members 
------解决思路----------------------
  Hierarchy Chart

See Also   WM_ICONERASEBKGND, CGdiObject::UnrealizeObject,WM_ERASEBKGND