我想在A对话框中点击按钮打开B对话框,然后在B对话框中点击按钮打开C对话框
或者这样连续打开多个对话框
我用DoModal只能打开一个对话框
还有个问题就是,当我打开B对话框时A对话框就关闭,打开C对话框时B对话框就关闭
我不知道用什么语句
以上就是我的问题
请高手给我解决下
谢谢!

解决方案 »

  1.   

    Domodal只能显示一个对话框么?如果要关闭前一个对话框,
    那就ShowWindow(SW_HIDE)。
      

  2.   

    ShowWindow(SW_HIDE)是隐藏控件的嘛
    并不是关闭前一个对话框
      

  3.   

    模态对话框是不可以的
    可以在App中这样调用CDlgApp::InitInstance()
    {
      ……  
      
     CDlgDlgA dlga;
     m_pMainWnd = &dlga;
     int nResponse = dlga.DoModal();
     if (nResponse == IDOK)
     {
      // TODO: Place code here to handle when the dialog is
      //  dismissed with OK
     }
     else if (nResponse == IDCANCEL)
     {
      // TODO: Place code here to handle when the dialog is
      //  dismissed with Cancel
     } CDlgDlgB dlgb;
     nResponse = dlgb.DoModal();
     if (nResponse == IDOK)
     {
      // TODO: Place code here to handle when the dialog is
      //  dismissed with OK
     }
     else if (nResponse == IDCANCEL)
     {
      // TODO: Place code here to handle when the dialog is
      //  dismissed with Cancel
     }
     
     CDlgDlgC dlgc;
     nResponse = dlgc.DoModal();
     if (nResponse == IDOK)
     {
      // TODO: Place code here to handle when the dialog is
      //  dismissed with OK
     }
     else if (nResponse == IDCANCEL)
     {
      // TODO: Place code here to handle when the dialog is
      //  dismissed with Cancel
     }
     
     ……