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

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




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

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