How to use Multiple DialogBox in One MFC application ?

Hi Experts,

I want to use  multiple  Dialog box  in one  MFC  Application. How Can i Do this ?
Actually i m telling the my Application nneeds :

1. Theris one Main Form  which contain 3 buttons. Sender, reciver,cancel.
2. On clicking Sender button it will open SENDER dialog page. On that (dialog)Page We have BACk button . Clicking to this   Back  Button , it will back to the  Main Form.
3. Similaly we can do in Reciver  form too.
4. Back Ground Form we want to Kill  or make it invisible.

How can i do this in  MFC Dialog Based  Application ?

Please  i need ur help...........

Who is Participating?
cookreConnect With a Mentor Commented:
SetFocus(hwnd of main form);
In the handler for the Back buttons, set focus to the desired control.
bharat_maneAuthor Commented:
please sent me the code ................
try this.

create a class for that sender dialog.

type the following code in that 'Sender' button handler in the main window

CSender dlg;

this->ShowWindow (SW_HIDE); // hides that main window
dlg.DoModal (); // show the sender dialog
this->ShowWindow (SW_NORMAL);  // restore the main dialog after the sender finishes.

in the 'Back' button handler of the sender window just call enddialog function to close the dialog.

hope this will help.
dont' hesitate if you have any doubts.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.