本帖最后由 VisualEleven 于 2012-11-29 11:54:45 编辑

解决方案 »

  1.   

    重写CButton类,添加处理虚函数DrawItem,MSDN上有例子代码可以参考一下
      

  2.   

    不是DLL特殊,而是按钮特殊。下面的代码仅供参考void CMyButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) 
    {
    // This code only works with buttons.
    ASSERT(lpDrawItemStruct->CtlType == ODT_BUTTON);

    UINT uStyle = DFCS_BUTTONPUSH;
    // If drawing selected, add the pushed style to DrawFrameControl.
    if (lpDrawItemStruct->itemState & ODS_SELECTED)
    uStyle |= DFCS_PUSHED;
    // Draw the button frame.
    ::DrawFrameControl(lpDrawItemStruct->hDC, &lpDrawItemStruct->rcItem, 
    DFC_BUTTON, uStyle);

    // Get the button's text.
    CString strText;
    GetWindowText(strText);
    COLORREF crOldColor = ::SetTextColor(lpDrawItemStruct->hDC, RGB(255,0,0));
    ::DrawText(lpDrawItemStruct->hDC, strText, strText.GetLength(), 
    &lpDrawItemStruct->rcItem, DT_SINGLELINE|DT_VCENTER|DT_CENTER); ::SetTextColor(lpDrawItemStruct->hDC, crOldColor);
    }
      

  3.   

    我的是在VS2005下写的C++,跟VC6.0有点不太一样、怎么添加重写CButton类,添加处理虚函数DrawItem之类的不是很清楚。
      

  4.   

    http://blog.csdn.net/hurryboylqs/article/details/5845684