how to relate two or more dialog boxes

Discussion in 'MFC' started by manmfc, Feb 11, 2008.

  1. manmfc

    manmfc New Member

    Joined:
    Sep 22, 2008
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    0
    Hi,
    I have created a dialog window called window1, this is the base one. And in that on Button action event I have created one more dialog window called window2. Now I returned to window1. On the wiondow1 whenever I click on the closing X mark on the right top corner of the window it should ask me "Do u want to exit message with Yes or no Button? I did that with AfxMessageBox("Do....",MB_YESNO,0); When I select no the window1 should not terminate. But it is terminating. how to do this? Help me.

    Regards
    AshokKumar.G
     
  2. Jadav Rakesh C.

    Jadav Rakesh C. New Member

    Joined:
    Nov 15, 2007
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    VC++ Developer
    Location:
    Surat
    Hi.........AshokKumar.G

    Override OnCancel method for window1 and copy line

    if(IDYES == AfxMessageBox("Exit",MB_YESNO,0))
    CDialog::OnCancel();

    Note ::
    IDABORT The Abort button was selected.

    IDCANCEL The Cancel button was selected.

    IDIGNORE The Ignore button was selected.

    IDNO The No button was selected.

    IDOK The OK button was selected.

    IDRETRY The Retry button was selected.

    IDYES The Yes button was selected.


    Enjoy ..Buddy.....................:)

    Regards
    Jadav Rakesh C.
    VC++ Developer
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice