草庐IT

MyPropertyPane

全部标签

c++ - CEdit 数字验证事件 C++ MFC

我有一个CEdit文本框,它是属性Pane的一部分,并且只允许数值(正整数)。当人们输入非数字值时,该框工作正常,但当他们删除框中的值时,会弹出一个对话框说:“请输入一个正整数。”情况是这样的:1.我在盒子里有一个数字(比如20)。2.我把号码删了。3.我收到错误对话框。谁能告诉我如何拦截此事件并在其中放置默认值?这是我的属性面板的样子:constintDEFAULT_VALUE=20;classMyPropertyPane:publicCPropertyPane{//....private:CEditm_NumericBox;intm_value;//....public:afx_m