#ifndef __my_edit_control_h__ #define __my_edit_control_h__ enum CheckType { CardNumType = 0, CommNumType, UnitType, HeavyType, PriceType, CountType, DoNotCheck }; class CEditBox : public CEdit { DECLARE_DYNAMIC(CEditBox) public: CEditBox(); ~CEditBox(); private: COLORREF m_clrFrame; protected: afx_msg void OnNcPaint(); DECLARE_MESSAGE_MAP() public: afx_msg void OnKillFocus(CWnd* pNewWnd); public: void SetEditRed(bool is_red); bool IsEditRed(); bool is_edit_red_; afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); void SetCheck(CheckType type); CheckType check_type_; bool CheckCardNum(CString num); bool CheckCommNum(CString num); bool CheckUnitNum(CString num); bool CheckHeavy(CString heavy); bool CheckPrice(CString price); bool CheckCount(CString count); }; #endif // __my_edit_control_h__