locked
Modal dialog losing modality (MFC) RRS feed

  • General discussion

  • I have a problem as below.

    Dialog B's parent window is dialog A.

    Dialog C's parent window is dialog B.

    All dialog are modal dialog. Window B will be closed automatically after 3 seconds, dialog C is be lost dialog modal information.

    So, I can operation on dialog A. Is there a way to change dialog C to modal dialog, change parent window to dialog A?

    • Moved by CoolDadTx Monday, April 15, 2013 1:50 PM C++ related
    • Changed type Elegentin Xie Tuesday, May 7, 2013 8:54 AM Not provide enough valuable information
    Monday, April 15, 2013 3:50 AM

All replies

  • Do you mean ABC are all modelless dialog and you want to change C to model dialog?

    Reply, then visible.

    Tuesday, April 16, 2013 11:33 AM
  • I have a problem as below.
     
    Dialog B's parent window is dialog A.
     
    Dialog C's parent window is dialog B.
     
    All dialog are modal dialog. Window B will be closed automatically after 3 seconds, dialog C is be lost dialog modal information.
     
    So, I can operation on dialog A. Is there a way to change dialog C to modal dialog, change parent window to dialog A?
    Why not just hide Dialog B rather than closing it?
     

    David Wilkinson | Visual C++ MVP
    Tuesday, April 16, 2013 1:44 PM
  • You need to destroy modal dialogs in the reverse order of creation.

    The problem is that when B is destroyed, it reenables A.

    Tuesday, April 16, 2013 2:05 PM
  • It should not be possible to close B when C is open, as C (and B and A also) is a modal dialog.  But maybe you are closing B programatically?
     
    What if you set Dialog C’s parent window to A when Dialog C is first created?  Then it doesn’t matter what B does.
     
    -- David
     

    Efficiently read and post to forums with newsreaders: http://communitybridge.codeplex.com
    Tuesday, April 16, 2013 8:11 PM