如何从属性表中删除确定,取消和应用按钮
How to remove ok,cancel and apply button from property sheets
所以我尝试使用此代码,但它不起作用:
CButton *btnApply;
btnApply = reinterpret_cast<CButton *>(GetDlgItem(IDOK));
btnApply->ShowWindow(FALSE);
提前谢谢。
使用 PSH_NOAPPLYNOW
隐藏属性表中的应用按钮
CMyPropertySheet psheet;
psheet.m_psh.dwFlags |= PSH_NOAPPLYNOW;
psheet.DoModal();
隐藏确定和取消按钮可以在CPropertyPage
中处理,需要父窗口的句柄,因为这些按钮位于父窗口中而不是页面窗口中:
BOOL CMyPropertyPage::OnSetActive()
{
BOOL res = CPropertyPage::OnSetActive();
CPropertySheet* psheet = (CPropertySheet*)GetParent();
psheet->GetDlgItem(IDOK)->ShowWindow(SW_HIDE);
psheet->GetDlgItem(IDCANCEL)->ShowWindow(SW_HIDE);
return res;
}
或在属性表中:
BOOL CMyPropertySheet::OnInitDialog()
{
BOOL res = CPropertySheet::OnInitDialog();
GetDlgItem(IDOK)->ShowWindow(SW_HIDE);
GetDlgItem(IDCANCEL)->ShowWindow(SW_HIDE);
return res;
}
在属性表中:
BOOL CMyPropertySheet::OnInitDialog()
{
CWnd *pWnd = GetParent()->GetDlgItem(IDHELP);
pWnd->ShowWindow( FALSE );
CWnd *pWnd1 = GetParent()->GetDlgItem(IDCANCEL);
pWnd1->ShowWindow( FALSE );
CWnd *pWnd2 = GetParent()->GetDlgItem(IDOK);
pWnd2->ShowWindow( FALSE );
CWnd *pWnd3 = GetParent()->GetDlgItem(0x3021);// 0x3021 == IDAPPLY
pWnd3->ShowWindow( FALSE )
}
相关文章:
- 挂起和取消挂起一个文件DLL
- 试图在visual studio上用C++创建一个桌面应用程序
- FFmpeg:制作一个应用程序比直接使用ffmepg更好吗
- 如何取消对nullptr的屏蔽,返回正确的对象
- c++r值引用应用于函数指针
- C++取消引用指针.为什么会发生变化
- 在C应用程序中运行C++(带有STL)函数
- 使用VerQueryValue检索应用程序的文件描述
- Qt C++静态thread_local QNetworkAccessManager是线程应用程序的好选择吗
- 使用取消引用的指针的多态性会产生意外的结果.为什么?
- 使用调试/崩溃报告将应用程序部署到客户端
- C++控制台应用程序阻止退出
- 码头化的C++应用程序是否向后兼容早期的内核版本
- 取消引用运算符不能重载
- 在他自己的方法中,有可能将一个对象取消引用到另一个对象吗
- 将应用程序从32位移植到64位时出现问题
- 如何在Qt中取消捕获字符串
- 如何从属性表中删除确定,取消和应用按钮
- 如果在应用程序外部取消拖动
- Qt应用程序取消退出事件