对话框中众多的EDITBOX(值已初始化-),怎么知道哪个被用户更改了
对话框中众多的EDITBOX(值已初始化-),如何知道哪个被用户更改了
小弟有一个属性页,里面有很多EDITBOX,我需要在点击确定按钮的时候知道是哪些EDITBOX被更改了(因为被更改的EDITBOX中的值会提交到服务器,为了节省资源),请问MFC中有没有自带的机制实现呢
------解决方案--------------------
一个EDIT被改变时是可以马上知道的,如果你想要在点击确定的时候知道很多的话,GetWindowText,一个一个比吧
------解决方案--------------------
EN_CHANGE
The EN_CHANGE notification message is sent when the user has taken an action that may have altered text in an edit control. Unlike the EN_UPDATE notification message, this notification message is sent after the system updates the screen. The parent window of the edit control receives this notification message through the WM_COMMAND message.
EN_UPDATE
The EN_UPDATE notification message is sent when an edit control is about to display altered text. This notification message is sent after the control has formatted the text, but before it displays the text. This makes it possible to resize the edit control window, if necessary. The parent window of the edit control receives this notification message through the WM_COMMAND message.
------解决方案--------------------
楼上的正解,添加EN_CHANGE的响应函数即可
------解决方案--------------------
定义个集合 CPtrArray,触发 EN_CHANGE 的CEdit对象添加进来,OnOK时候遍历这个CPtrArray内部的成员就可以了。
小弟有一个属性页,里面有很多EDITBOX,我需要在点击确定按钮的时候知道是哪些EDITBOX被更改了(因为被更改的EDITBOX中的值会提交到服务器,为了节省资源),请问MFC中有没有自带的机制实现呢
------解决方案--------------------
一个EDIT被改变时是可以马上知道的,如果你想要在点击确定的时候知道很多的话,GetWindowText,一个一个比吧
------解决方案--------------------
EN_CHANGE
The EN_CHANGE notification message is sent when the user has taken an action that may have altered text in an edit control. Unlike the EN_UPDATE notification message, this notification message is sent after the system updates the screen. The parent window of the edit control receives this notification message through the WM_COMMAND message.
EN_UPDATE
The EN_UPDATE notification message is sent when an edit control is about to display altered text. This notification message is sent after the control has formatted the text, but before it displays the text. This makes it possible to resize the edit control window, if necessary. The parent window of the edit control receives this notification message through the WM_COMMAND message.
------解决方案--------------------
楼上的正解,添加EN_CHANGE的响应函数即可
------解决方案--------------------
定义个集合 CPtrArray,触发 EN_CHANGE 的CEdit对象添加进来,OnOK时候遍历这个CPtrArray内部的成员就可以了。