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 make my modal dialog box go away

    I created a modal dialog box which pops up when I click the SDI child area with the left mouse button. The dialog box has 2 options, forward and backward, both of which lead to different modal dialog boxes.
    When I click forward or backward button though, my original control dialog box which had the 2 push button options won't go away. This really drives me nuts! I have appended my code below. Is there anything I can do to remove this 'control' dialog box after I selected a push button?

    Any response any one can give me will be greatly appreciated.

    void CBloodAlcoholView::OnLButtonDown(UINT nFlags, CPoint point)
    {
    CControl controlDlg;
    controlDlg.DoModal();
    }

    void CBloodAlcoholView::OnCalculateBackward()
    {
    CClientDC cDC(this);
    cDC.TextOut(10,10,"calculate forward");

    CBackward backwardDlg;
    backwardDlg.DoModal();
    }

    void CBloodAlcoholView::OnCalculateForward()
    {
    CClientDC cDC(this);
    cDC.TextOut(10,10,"calculate forward");

    CForward forwardDlg;
    forwardDlg.DoModal();
    }



  2. #2

    Re: how can I make my modal dialog box go away

    do you need call SendMessage(WM_CLOSE, 0, 0) in OnMyButtonPressed() dialog memeber functions (use class wizard to create them)?


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