属性表单类中的OnInitDialog改为:
BOOL CRefGenProSheet::OnInitDialog()
{
BOOL bResult = CPropertySheet::OnInitDialog();
// TODO: Add your specialized code here
GetDlgItem(IDOK)->ShowWindow(SW_HIDE);
GetDlgItem(IDCANCEL)->ShowWindow(SW_HIDE);
GetDlgItem(ID_APPLY_NOW)->ShowWindow(SW_HIDE);
GetDlgItem(IDHELP)->ShowWindow(SW_HIDE);
CRect btnRect;
CRect wdnRect;
GetDlgItem(IDCANCEL)->GetWindowRect(&btnRect);
GetWindowRect(&wdnRect);
//调整窗体大小
::SetWindowPos(this->m_hWnd, HWND_TOP, 0,0,wdnRect.Width(),wdnRect.Height() - btnRect.Height()-10, SWP_NOMOVE | SWP_NOZORDER);
return bResult;
}
本文介绍了一个C++ MFC应用程序中如何通过OnInitDialog函数隐藏对话框中的OK、Cancel、Apply及帮助按钮,并调整窗口大小。

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



