class CMainPropertySheet : public CProperty
{
};
BOOL CMainPropertySheet: OnCommand(WPARAM wParam, LPARAM lParam)
{
// TODO: Add your specialized code here and/or call the base class
if (LOWORD(wParam) == IDOK)
{
int nPageIndex = GetActiveIndex();
if (0 != nPageIndex)
{
//do something
return TRUE;
}
else
{
return FALSE;
}
}
return CPropertySheet: nCommand(wParam, lParam);
}
return False 为系统自动处理
return true就是响应我们的,并告诉系统我们已经处理过了,系统不用处理了
所以如果要点IDOK时不让CProperty关闭,则只需要设置返回true
本文介绍了如何在CPropertySheet中自定义IDOK按钮的行为,通过重写OnCommand方法实现特定的功能处理,如阻止默认关闭行为。
1795

被折叠的 条评论
为什么被折叠?



