一、
1.子对话框在属性设置以下(在代码里设置这些属性没用,创建窗口后,代码设置没用)
1.1 边框:None
1.2 标题栏:false
1.3 样式:Child
2.主对话框放置一个Static Text控件,此控件大小就是放置子窗体区域
二、
Dialog1 子界面
void CMyMFCSampleDlg::LoadUI() { CRect IFramerect; CStatic* pStatic; pStatic = (CStatic*)GetDlgItem(IDC_STATIC); dlg1 = new Dialog1(this); dlg1->Create(IDD_DIALOG1, pStatic); dlg1->GetWindowRect(IFramerect); dlg1->SetWindowPos(&wndTop, 0, 0, IFramerect.Width(), IFramerect.Height(), SWP_SHOWWINDOW); dlg1->ShowWindow(SW_SHOW); }