CMyButton m_button;
m_button.ModifyStyle();

解决方案 »

  1.   

    我在派生内中实现,如在attach中实现
        GetDlgItem(nID)->ModifyStyleEx(0,BS_OWNERDRAW,0);
        if (!SubclassDlgItem(nID, pParent))
            return FALSE;
    为什么会出错
      

  2.   

    既然是自画,在drawitem里你爱怎么改就怎么改
      

  3.   

    MyButton::OnCreate(LPCREATESTRUCT lpCreateStruct)
    {
    //modify normal style bits
      lpCreateStruct->Style = ;//assign value
      lpCreateStruct->Style &= ;//mask off some bits
      lpCreateStruct->Style |= ;//add some bits
    //modify extended style bits
      lpCreateStruct->dwExStyle = ;
      lpCreateStruct->dwExStyle &= ;
      lpCreateStruct->dwExStyle |= ;
    //call default create rutine with the style you specified just now
    return CButton::OnCreate(lpCreateStruct);
    }