5555555.... 以前我都是这样的。 int Result=Sheet.DoModal(); if(Result=IDCANCEL) { ..... } 现在没办法了,重载啊?可是这个Sheet都没有文件啊,是自动生成的啊,我重载到哪儿啊不知道是我太笨,还是怎么样,如果没有办法,只有在上面加按钮了。可是,怎么加?
你想处理X按钮,就重载OnSysCommand函数。CWnd::OnSysCommand This method is called by the framework when the user selects a command from the Control menu, or when the user selects the Maximize or the Minimize button. afx_msg void OnSysCommand( UINT nID, LPARAM lParam ); Parameters nID Specifies the type of system command requested. This parameter can be any one of the following values: SC_CLOSE Close the CWnd object.
CMyDialog::OnCancel()
{
//do something //如果调用CDialog::OnCancel()表明这个操作有效,对话框会消失或隐藏
//不调用的时候,比如你不想回车或者ESC起作用
}
上面没有按钮,只有一个X,以前生成的都有按钮。
以前我都是这样的。
int Result=Sheet.DoModal();
if(Result=IDCANCEL)
{
.....
}
现在没办法了,重载啊?可是这个Sheet都没有文件啊,是自动生成的啊,我重载到哪儿啊不知道是我太笨,还是怎么样,如果没有办法,只有在上面加按钮了。可是,怎么加?
This method is called by the framework when the user selects a command from the Control menu, or when the user selects the Maximize or the Minimize button. afx_msg void OnSysCommand(
UINT nID,
LPARAM lParam );
Parameters
nID
Specifies the type of system command requested. This parameter can be any one of the following values:
SC_CLOSE Close the CWnd object.