[英]How to set the CPropertyPage title in Wizard mode
我正在嘗試以MFC格式動態設置CPropertyPage的標題。 此表單使用向導模式創建。 這是我的代碼。 此代碼編譯和運行不會設置標題。 如何設置向導窗口的標題?
BOOL MyForm::OnSetActive()
{
CPropertySheet* pWnd = (CPropertySheet*) GetParent();
pWnd->SetTitle(L"My Title",PSH_PROPTITLE);
return CPropertyPage::OnSetActive();
}
嘗試在事件WM_SHOWWINDOW上執行此操作。 我的代碼就像:
void CPropSIni::OnShowWindow(BOOL bShow, UINT nStatus)
{
CPropertyPage::OnShowWindow(bShow, nStatus);
CNodeSheet* pSheet = (CNodeSheet*)GetParent();
if ( (bShow==TRUE) && (pSheet->IsWizard()) )
{
CString strTemp;
pSheet->GetWindowText(strTemp);
CString strCaption;
strCaption = CustomFormat(CART_CAPTION_FORMAT_ADD, 2, strTemp, pSheet->m_Name);
CPropertyPage::OnSetActive();
pSheet->SetTitle(strCaption);
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.