使用PropertySheet的問題
我在基於對話框的程序中使用了PropertySheet的一段代碼,可是屬性頁卻做為子窗口彈出來,而不是嵌入到對話框中,請問是怎麼回事?謝謝!
BOOL CMyPropSheetDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
CRect rect(0, 0, 0, 0);
m_PropSheet.Create(this, WS_CHILD | WS_VISIBLE, 0);
GetDlgItem(IDC_PROPSHEET)->GetWindowRect(&rect);
m_PropSheet.ModifyStyleEx(0, WS_EX_CONTROLPARENT);
m_PropSheet.ModifyStyle(0, WS_TABSTOP);
ScreenToClient(&rect);
m_PropSheet.SetWindowPos(NULL, 0, 0, rect.Width(), rect.Height(), SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE);
return TRUE; // return TRUE unless you set the focus to a control
}