OnCtlColor 累次向edit控件插入数据,原来的数据清除,显示数据重叠,求解决

OnCtlColor 多次向edit控件插入数据,原来的数据清除,显示数据重叠,求解决!
C/C++ code

void CPostionAPTestView::OnPaint()
{
    CPaintDC dc(this); // device context for painting
    CBrush brush(g_FormColor);
    CRect rect;
    GetClientRect(&rect);
    dc.FillRect(&rect, &brush);
}

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

    // TODO:  在此更改 DC 的任何特性
    HBRUSH B;
    CRect rect;
    switch(nCtlColor)
    {
    case CTLCOLOR_STATIC:
        {
        pDC->SetTextColor(g_TextColor);
        pDC->SetBkMode(TRANSPARENT); //设置字体背景为透明
        B = (HBRUSH)::GetStockObject(NULL_BRUSH); //背景色设置
        return B;
        }
    case CTLCOLOR_LISTBOX:
    case CTLCOLOR_EDIT:
        {
        pDC->SetBkMode(TRANSPARENT); //设置字体背景为透明
        pDC->SetTextColor(g_TextColor);
        B=CreateSolidBrush(g_FormColor);
        switch(pWnd->GetDlgCtrlID())
        {
           case IDC_POSTION_EDIT:
                pDC->SetTextColor(colour);
                break;
        }
        return B;
        }
    }
    // TODO:  如果默认的不是所需画笔,则返回另一个画笔
    return hbr;
}



如题所示↑,重叠出现之后,界面切换一下显示又恢复正常了,再次写入数据还是会重叠在一起 ,不知道在哪里处理一下!

------解决方案--------------------
GetDlgItem(IDC_EDIT1)->Invalidate(FALSE);//如果无效就改成TRUE
就是让EDIT控件收到新数据后自己更新一下