不知你想平到什么程度,方便的是在资源编辑器中将按钮加上Flat属性,还想更平的话,选择OwnerDraw。

解决方案 »

  1.   

    要不要FlatButton的类,如果要,给我留信息或给我发mail:[email protected],我发mail给你.下面是它的.h文件:
    class CFlatButton : public CButton
    {
    // Construction
    public:
    CFlatButton();// Attributes
    public:

    // Fuctions 

    private:
    BOOL m_MouseOnButton;
    BOOL m_bButtonPress;
    BOOL m_bArrowPress;
    BOOL m_bTrackSelection; CRect m_rectButton;
    CRect m_rectArrow;

    COLORREF m_clrCurrent;// Operations
    public:
    COLORREF GetColor();
    void  SetColor(COLORREF clrColor);
    // Overrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CFlatButton)
    public:
    virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
    //}}AFX_VIRTUAL// Implementation
    public:
    virtual ~CFlatButton(); // Generated message map functions
    protected:
    //{{AFX_MSG(CFlatButton)
    afx_msg void OnMouseMove(UINT nFlags, CPoint point);
    afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
    afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
    //}}AFX_MSG
    afx_msg LONG OnSelEndOK(UINT lParam, LONG wParam);
        afx_msg LONG OnSelEndCancel(UINT lParam, LONG wParam);
        afx_msg LONG OnSelChange(UINT lParam, LONG wParam); DECLARE_MESSAGE_MAP()
    };
      

  2.   

    没有这么复杂吧。既然在资源编辑器里可以设成flat,那么在程序里肯定有函数可以实现这一功能的。
    还请再提示一下为好
      

  3.   

    CButton::SetButtonStyle()函数声明
    void SetButtonStyle(
       UINT nStyle,
       BOOL bRedraw = TRUE 
    );
      

  4.   

    Button Styles 里哪个风格是flat的?请指明,谢谢
      

  5.   

    最好设置owerdraw, 然后在OnDrawItem中自己画