I would concur with CPAllini's response with an adjustment.
CPallini wrote:
Assuming your dialog has a parent window, then, on button click, you should:
1. Notify to the parent window that the other dialog should be open (you may set a flag, for instance).
2. Close the current dialog.
I would not, however, set a flag to notify the parent window. Instead I would either:
1) Send the parent a Window's message. This requires you to use a custom windows message and implement a handler for it in the parent.
or
2) Call a method of the parent dialog's object. This requires that the child dialog was previously provided with a properly typed reference or pointer to the parent dialog.
I would prefer option 1 as it does not seem to require as quite as much coupling between the classes.
If you do opt for Jast_in's answer, make sure you do pay attention to exactly when & how you will see that the hidden window gets redisplayed or closed.