Thread: Have a new dialog replace another one

  1. #1
    Registered User
    Join Date
    Dec 2004
    Posts
    205

    Have a new dialog replace another one

    Hi,
    Is it possible to replace a dialog with another one. Lets say I have dialog A and B. A button in dialog A creates another dialog B. The problem is that although dialog A cannot be used while dialog B is opened, I would like the content of dialog B to replace the content of dialog A so that there is only 1 dialog open at any one time although an instance of class A and B still exists. I hope this makes sense. Thanks
    Amish

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    One solution is modeless style.

    Kuphryn

  3. #3
    Registered User
    Join Date
    Dec 2004
    Posts
    205
    modeless style would allow the previous dialog to be accessible. I need the content of dialog A to be replaced or hidden by the content of dialog B. Therefore if a user moves dialog B, they won't see dialog A in the background. I don't just want to put all buttons in one dialog and then hide some and show some. That would be easy. They should be in different dialog boxes. That's my problem.
    Amish

  4. #4
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    ShowWindow(Dialog, SW_HIDE) or DestroyWindow(Dialog), that's what you're looking for?
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  5. #5
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    No. Each dialog window is an independent entity.

    Kuphryn

  6. #6
    Registered User
    Join Date
    Dec 2004
    Posts
    205
    Exactly each dialog has it's own class and is it's own object separate from the other dialog. The only link would be when one dialog create the other one and gets a handle to the child object or something like that.
    Amish

  7. #7
    Registered User
    Join Date
    Dec 2004
    Posts
    205
    Ok so it seems to work now. This is what I did. Create a main dialog box A with frame, border, etc... Then create a second dialog B without any frame and set with style child. Then create a modeless version of dialog B from A. It would seem that dialog B appears inside the frame of A and covers all the original buttons of A. So far so good. I hope this is the end of my issues. Thanks for your answers.
    Amish

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 02-13-2008, 02:59 PM
  2. make Child Dialog not Popup?
    By Zeusbwr in forum Windows Programming
    Replies: 5
    Last Post: 04-08-2005, 02:42 PM
  3. Getting the position of a dialog without parent on the screen
    By stormbringer in forum Windows Programming
    Replies: 1
    Last Post: 08-27-2003, 02:59 AM
  4. Remove Dialog and Replace
    By kybert in forum Windows Programming
    Replies: 0
    Last Post: 09-14-2002, 02:28 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM