How to  use Multiple DialogBox in One MFC application ?

Posted on 2005-04-19
Last Modified: 2010-04-17

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

Question by:bharat_mane
    LVL 23

    Expert Comment

    In the handler for the Back buttons, set focus to the desired control.

    Author Comment

    please sent me the code ................
    LVL 23

    Accepted Solution

    SetFocus(hwnd of main form);
    LVL 6

    Expert Comment

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Javascript: Crash Course

    Javascript is not only emerging as the most important language to know, it's flexibility is unique. With Javascript being deployed on the web, mobile and even the desktop this is the one language that all technologists need to know.

    Suggested Solutions

    This article is filled with multiple code samples and explanations for mathematical calculations. They are as follows: 1. General tips 2. Quadratic formula 3. Object collision 4. Projectile path General Tips       Here are some of my tips f…
    Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now