怎样获得前一控件的ID号解决方案
怎样获得前一控件的ID号
初学者
不知道控件这个词合不合适
例如,单击对话框上的 按钮1
当单击 按钮2 时
想获得 按钮1 的ID
请问有什么函数吗
非常感谢!!
------解决方案--------------------
CWnd::GetDlgCtrlID
int GetDlgCtrlID( ) const;
Return Value:
The numeric identifier of the CWnd child window if the function is successful; otherwise 0.
Remarks:
Returns the window or control ID value for any child window, not only that of a control in a dialog box. Since top-level windows do not have an ID value, the return value of this function is invalid if the CWnd is a top-level window.
------解决方案--------------------
按按钮2的时候调用GetDlgCtrlID( )得到的是按钮2的ID吧!
------解决方案--------------------
可以重载控件的OnSetFocus()函数,获得前一个具有焦点的窗口。
初学者
不知道控件这个词合不合适
例如,单击对话框上的 按钮1
当单击 按钮2 时
想获得 按钮1 的ID
请问有什么函数吗
非常感谢!!
------解决方案--------------------
CWnd::GetDlgCtrlID
int GetDlgCtrlID( ) const;
Return Value:
The numeric identifier of the CWnd child window if the function is successful; otherwise 0.
Remarks:
Returns the window or control ID value for any child window, not only that of a control in a dialog box. Since top-level windows do not have an ID value, the return value of this function is invalid if the CWnd is a top-level window.
------解决方案--------------------
按按钮2的时候调用GetDlgCtrlID( )得到的是按钮2的ID吧!
------解决方案--------------------
可以重载控件的OnSetFocus()函数,获得前一个具有焦点的窗口。