如何对编辑框中的文本描边?
急用,谢了!

解决方案 »

  1.   

    什么是描边啊?
    http://topic.csdn.net/t/20041006/10/3428734.html
      

  2.   

    新建个子类,继承父类CEdit,在OnNcPaint里面加入以下代码
    void CMyEdit::OnNcPaint() 
    {
    // TODO: Add your message handler code here

    // Do not call CEdit::OnNcPaint() for painting messages
    CBrush *m_pBoundryBrush = new CBrush(RGB(111,222,99));
    CWindowDC   DC(this);   
    CRect   Rect;   
    GetWindowRect(&Rect);       
    DC.DrawEdge(CRect(0,0,Rect.Width(),Rect.Height()),EDGE_SUNKEN,BF_FLAT|BF_RECT);    
    m_pBoundryBrush->DeleteObject();
    delete m_pBoundryBrush;
    }
    再将CMyEdit关联到你的edit控件~:) 
      

  3.   

    这样可以了,上面的写错了.
    void CMyEdit::OnNcPaint() 
    {
    // TODO: Add your message handler code here
    CDC* pDC = GetWindowDC( );
    CRect rect;
    GetWindowRect( &rect);
    rect.OffsetRect( -rect.left, -rect.top);

    //Draw a single line around the outside
    CBrush brush( RGB( 255, 0, 0));
    pDC->FrameRect( &rect, &brush);
    ReleaseDC( pDC);
    }