给你3角类 class CTriangleButton : public CButton { public: enum POINTDIRECTION {POINT_UP, POINT_DOWN, POINT_LEFT, POINT_RIGHT};
// Construction public: CTriangleButton(); virtual ~CTriangleButton();// Attributes public:protected: POINTDIRECTION PointDirection; CRgn CurrentRegion;// Operations public:// Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CTriangleButton) public: virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); protected: virtual void PreSubclassWindow(); //}}AFX_VIRTUALpublic: //note: SetWindowPos decreases the cx, cy parameter to nearest number dividable by two BOOL SetWindowPos(const CWnd* pWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags );// Implementation public: void SetDirection(POINTDIRECTION PointDirection); //sets the direction of triangle POINTDIRECTION GetDirection(); //gets the direction of triangle // Generated message map functions protected: //{{AFX_MSG(CTriangleButton) //}}AFX_MSG DECLARE_MESSAGE_MAP() };
SetWindowRGN
look out MSDN for detail
class CTriangleButton : public CButton
{
public:
enum POINTDIRECTION {POINT_UP, POINT_DOWN, POINT_LEFT, POINT_RIGHT};
// Construction
public:
CTriangleButton();
virtual ~CTriangleButton();// Attributes
public:protected:
POINTDIRECTION PointDirection;
CRgn CurrentRegion;// Operations
public:// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTriangleButton)
public:
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
protected:
virtual void PreSubclassWindow();
//}}AFX_VIRTUALpublic:
//note: SetWindowPos decreases the cx, cy parameter to nearest number dividable by two
BOOL SetWindowPos(const CWnd* pWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags );// Implementation
public:
void SetDirection(POINTDIRECTION PointDirection); //sets the direction of triangle
POINTDIRECTION GetDirection(); //gets the direction of triangle // Generated message map functions
protected:
//{{AFX_MSG(CTriangleButton)
//}}AFX_MSG DECLARE_MESSAGE_MAP()
};