- //NumberEdit.h
- #ifndef __NUMBEREDIT_H__
- #define __NUMBEREDIT_H__
- class CNumberEdit : public CEdit
- {
- public:
- CNumberEdit();
- virtual ~CNumberEdit();
- void SetAfterDotLen(UINT iAfterDotLen){m_iAfterDotLen =iAfterDotLen;}
- UINT GetAfterDotLen(){ return m_iAfterDotLen;}
- void SetAfterIntLen(UINT iAfterIntLen){m_iAfterIntLen =iAfterIntLen;}
- UINT GetAfterIntLen(){ return m_iAfterIntLen;}
- protected:
- BOOL CheckNumber(UINT nChar,UINT nRepCnt,UINT nFlags);
- //BOOL CheckOnePlus(UINT nChar,UINT nRepCnt,UINT nFlags);
- BOOL CheckOneMinus(UINT nChar,UINT nRepCnt,UINT nFlags);
- BOOL CheckOneDot(UINT nChar,UINT nRepCnt,UINT nFlags);
- int GetCaretXPos();
- CString m_str;
- UINT m_iAfterDotLen;
- UINT m_iAfterIntLen;
- protected:
- //{ {AFX_MSG(CUntcNumberEdit)
- afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
- afx_msg void OnKillfocus();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- #endif
- //Numbe
新完善的NumberEdit控件,能设定小数位和整数位
最新推荐文章于 2023-05-25 15:16:02 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)