create 2 dialog template resource:IDD_DIALOG1,IDD_DIALOG2; //change their style from popup to child. Create New class corresponding to them as CDialog1, CDialog2; Add members to the View class CDialog1 m_dialog1; CDialog2 m_dialog2; add message handler of WM_CREATE to the View class ... m_dialog1.Create(IDD_DIALOG1,this); m_dialog2.Create(IDD_DIALOG2,this); add message handler for WM_SIZE message of View ... RECT rect; GetClientRect(&rect); if(::IsWindow(m_dialog1)) m_dialog1.MoveWindow(&rect,TRUE); if(::IsWindow(m_dialog2)) m_dialog2.MoveWindow(&rect,TRUE); To change dialog view: void CPmdView::OnViewDialog1() { m_dialog2.ShowWindow(SW_HIDE); m_dialog1.ShowWindow(SW_SHOW); // TODO: Add your command handler code here }void CPmdView::OnViewDialog2() { // TODO: Add your command handler code here m_dialog1.ShowWindow(SW_HIDE); m_dialog2.ShowWindow(SW_SHOW);
Create New class corresponding to them as CDialog1, CDialog2;
Add members to the View class
CDialog1 m_dialog1;
CDialog2 m_dialog2;
add message handler of WM_CREATE to the View class
...
m_dialog1.Create(IDD_DIALOG1,this);
m_dialog2.Create(IDD_DIALOG2,this);
add message handler for WM_SIZE message of View
...
RECT rect;
GetClientRect(&rect);
if(::IsWindow(m_dialog1))
m_dialog1.MoveWindow(&rect,TRUE);
if(::IsWindow(m_dialog2))
m_dialog2.MoveWindow(&rect,TRUE);
To change dialog view:
void CPmdView::OnViewDialog1()
{
m_dialog2.ShowWindow(SW_HIDE);
m_dialog1.ShowWindow(SW_SHOW);
// TODO: Add your command handler code here
}void CPmdView::OnViewDialog2()
{
// TODO: Add your command handler code here
m_dialog1.ShowWindow(SW_HIDE);
m_dialog2.ShowWindow(SW_SHOW);
}