CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    327

    how can I force a dialog box to disappear and create another

    I created dialog based application and I have 2 separate modal dialog boxes. If the user
    hits ok in the first modal dialog box, I want that modal box to disappear and the other
    dialog box to popup, but when I implement the following code;

    void Modal::OnOk()
    {
    DestroyWindow();

    CModal1 dlg1;
    dlg1.DoModal();
    }

    both dialog boxes disappear. Is there any way I can specify that I want
    just the first modal dialog box to disappear?

    Details are cherished. Any response anyone can give me will be greatly
    appreciated.



  2. #2
    Join Date
    May 1999
    Posts
    42

    Re: how can I force a dialog box to disappear and create another

    Use ShowWindow(SW_HIDE) prior to the DoModal call, such as:

    void CTwoDlgTestDlg::OnOK()
    {
    ShowWindow(SW_HIDE);
    CDlgTwo dlg;
    dlg.DoModal();

    CDialog::OnOK();
    }



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured