如果你在itemchanged事件中判断是否符合要求,请注意:
在itemchanged事件的返回值定义如下:
0 (Default) Accept the data value
1 Reject the data value and don't allow focus to change
2 Reject the data value but allow the focus to change
当不符合时,若return 1 ,则焦点不允许离开,return 2则焦点允许离开;同时会触发itemerror事件,itemerror事件的返回值宥 如下定义:
0 (Default) Reject the data value and show an error message box
1 Reject the data value with no message box
2 Accept the data value
3 Reject the data value but allow focus to change
如果你想拒绝不符合条件的值又不想出现系统提示,在itemerror中return 1