[Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 289
  • Last Modified:

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...........

  • 2
1 Solution
In the handler for the Back buttons, set focus to the desired control.
bharat_maneAuthor Commented:
please sent me the code ................
SetFocus(hwnd of main form);
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.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now