当CEdit对象的内容改变,系统会发送EN_CHANGE消息,但是如何知道哪些内容被改变了?

解决方案 »

  1.   

    比较EN_CHANGE消息前后编辑控件中的内容不就知道了?
      

  2.   

    晕,你改动一个字符它就变化了  就会收到 EM_CHANGE 消息你想知道写入了什么?用 OnChar 吧
      

  3.   

    This method is called by the framework when a keystroke translates to a nonsystem character. This method is called before the OnKeyUp method and after the OnKeyDown method are called. OnChar contains the value of the keyboard key being pressed or released. Because there is not necessarily a one-to-one correspondence between keys pressed and OnChar calls generated, the information in nFlags is generally not useful to applications. The information in nFlags applies only to the most recent call to the OnKeyUp method or the OnKeyDown method that precedes the call to OnChar.afx_msg void OnChar(
    UINT nChar,
    UINT nRepCnt,
    UINT nFlags ); 
      

  4.   

    在获得焦点和失去焦点时判断.进入时记录OldString,在失去焦点时再对比NewString