我想在第一个dialog的onbutton里先隐藏第一个dialog,然后domodal第二个dialog,但怎么隐藏第一个?
或者还有别的方法?

解决方案 »

  1.   

    用 showwindow() 将第一个窗口隐藏。
    然后 domodal 第二个窗口
    第二个返回后,在用 showwindow() 把第一个显示出来
      

  2.   

    有很多方法,现提供一种,可以试试
    OnButton1(...)
    {
      CMyDialog2 dlg;
      this->ShowWindow(SM_HIDE);
     dlg.DoModal();
      this->ShowWindow(SM_SHOW);
    }
      

  3.   

    用這樣的:
    DLG1的OnButton里
    {
       CYourDialog dlg(this);
       this->ShowWindow(SW_HIDE);
       dlg.DoModal();
    }
    然後在dlg里做如下動作:
    BOOL CYourDialog::DestroyWindow() 
    {
    // TODO: Add your specialized code here and/or call the base class
    this->lpParent->ShowWindow(SW_SHOW);
    return CDialog::DestroyWindow();

    }
      

  4.   

    this->EndDialog(0);  用0和1有什么区别?
      

  5.   

    是不是每个dialog都需要对应一个类?