Closing Dialog window
-
Hi, I have 3 Dialog window , when the application runs it loads the initial dialog DTDlg from there when I click on next button it opens the 2nd dialog window I have used ( m_dUpdateDlg.DoModal (); ) code to open the 2nd window. From 2nd window when click on next window button it opens the 3rd window ( m_dStatusDlg.DoModal (); ) In this process all the 3 window will be open one above the other I want to know how close the 2nd dialog window then open the 3r d window.?? Please can anyone tell me how to close and then open other dialog window?? Regards, Parichay.
-
Hi, I have 3 Dialog window , when the application runs it loads the initial dialog DTDlg from there when I click on next button it opens the 2nd dialog window I have used ( m_dUpdateDlg.DoModal (); ) code to open the 2nd window. From 2nd window when click on next window button it opens the 3rd window ( m_dStatusDlg.DoModal (); ) In this process all the 3 window will be open one above the other I want to know how close the 2nd dialog window then open the 3r d window.?? Please can anyone tell me how to close and then open other dialog window?? Regards, Parichay.
where have u put in the code to for calling the constructor for dialogs..?
-
where have u put in the code to for calling the constructor for dialogs..?
void CCreateDlg::OnOk() { // TODO: Add your control notification handler code here int iResults; // This variable will capture the button selection // Ask the user iResults = MessageBox("Would u like to add documetns to the index now", "Desktop Search",MB_YESNO | MB_ICONQUESTION); // Determine which button the user clicked // Give the user a message showing which button was clicked switch (iResults) { case IDYES: // The Yes button? //call the Update dialog window if user press yes m_dUpdateDlg.DoModal (); break; case IDNO: // The No button? OnOK(); break; } } i have added the code on ok button when user press yes it opens the 2nd dialog box , iwant to know how to close the present dialog box then open the new dialog box.
-
void CCreateDlg::OnOk() { // TODO: Add your control notification handler code here int iResults; // This variable will capture the button selection // Ask the user iResults = MessageBox("Would u like to add documetns to the index now", "Desktop Search",MB_YESNO | MB_ICONQUESTION); // Determine which button the user clicked // Give the user a message showing which button was clicked switch (iResults) { case IDYES: // The Yes button? //call the Update dialog window if user press yes m_dUpdateDlg.DoModal (); break; case IDNO: // The No button? OnOK(); break; } } i have added the code on ok button when user press yes it opens the 2nd dialog box , iwant to know how to close the present dialog box then open the new dialog box.
Try keeping the oonok call outside swich... it shuld work.... as i have done below void CCreateDlg::OnOk() { // TODO: Add your control notification handler code here int iResults; // This variable will capture the button selection // Ask the user iResults = MessageBox("Would u like to add documetns to the index now", "Desktop Search",MB_YESNO | MB_ICONQUESTION); // Determine which button the user clicked // Give the user a message showing which button was clicked switch (iResults) { case IDYES: // The Yes button? //call the Update dialog window if user press yes m_dUpdateDlg.DoModal (); break; case IDNO: // The No button? break; } OnOK(); }
-
Try keeping the oonok call outside swich... it shuld work.... as i have done below void CCreateDlg::OnOk() { // TODO: Add your control notification handler code here int iResults; // This variable will capture the button selection // Ask the user iResults = MessageBox("Would u like to add documetns to the index now", "Desktop Search",MB_YESNO | MB_ICONQUESTION); // Determine which button the user clicked // Give the user a message showing which button was clicked switch (iResults) { case IDYES: // The Yes button? //call the Update dialog window if user press yes m_dUpdateDlg.DoModal (); break; case IDNO: // The No button? break; } OnOK(); }
I changed the code i placed the OnOK() after switch but dialog box is not closing. still the 2nd window is open .. can plz tell me anymore solutins??
-
void CCreateDlg::OnOk() { // TODO: Add your control notification handler code here int iResults; // This variable will capture the button selection // Ask the user iResults = MessageBox("Would u like to add documetns to the index now", "Desktop Search",MB_YESNO | MB_ICONQUESTION); // Determine which button the user clicked // Give the user a message showing which button was clicked switch (iResults) { case IDYES: // The Yes button? //call the Update dialog window if user press yes m_dUpdateDlg.DoModal (); break; case IDNO: // The No button? OnOK(); break; } } i have added the code on ok button when user press yes it opens the 2nd dialog box , iwant to know how to close the present dialog box then open the new dialog box.
call CDialog::OnOk imeediately before switch -- modified at 5:03 Monday 10th April, 2006
-
Try keeping the oonok call outside swich... it shuld work.... as i have done below void CCreateDlg::OnOk() { // TODO: Add your control notification handler code here int iResults; // This variable will capture the button selection // Ask the user iResults = MessageBox("Would u like to add documetns to the index now", "Desktop Search",MB_YESNO | MB_ICONQUESTION); // Determine which button the user clicked // Give the user a message showing which button was clicked switch (iResults) { case IDYES: // The Yes button? //call the Update dialog window if user press yes m_dUpdateDlg.DoModal (); break; case IDNO: // The No button? break; } OnOK(); }
-
Hi, I have 3 Dialog window , when the application runs it loads the initial dialog DTDlg from there when I click on next button it opens the 2nd dialog window I have used ( m_dUpdateDlg.DoModal (); ) code to open the 2nd window. From 2nd window when click on next window button it opens the 3rd window ( m_dStatusDlg.DoModal (); ) In this process all the 3 window will be open one above the other I want to know how close the 2nd dialog window then open the 3r d window.?? Please can anyone tell me how to close and then open other dialog window?? Regards, Parichay.
Hi yes, before calling the domodal fr any dialog destroy the previous one by using EndDialog. But I would suggest you implement the child dialog concept. So that when you close the first dialog you will not get he flickering effect. adn there you willnot face problem for closing and switching betwen the dialogs. Cheers "Peace of mind through Technology"
-
Hi, I have 3 Dialog window , when the application runs it loads the initial dialog DTDlg from there when I click on next button it opens the 2nd dialog window I have used ( m_dUpdateDlg.DoModal (); ) code to open the 2nd window. From 2nd window when click on next window button it opens the 3rd window ( m_dStatusDlg.DoModal (); ) In this process all the 3 window will be open one above the other I want to know how close the 2nd dialog window then open the 3r d window.?? Please can anyone tell me how to close and then open other dialog window?? Regards, Parichay.
Keep it simple - open both (the 2nd and 3rd) from the 1st dialog. When the second dialog is closed it will return a value indicating what button/command was used to close it. So you can, for example, open the third dialog if the second one returned
IDOK
. Peace! -=- James
If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
DeleteFXPFiles & CheckFavorites (Please rate this post!) -
Hi, I have 3 Dialog window , when the application runs it loads the initial dialog DTDlg from there when I click on next button it opens the 2nd dialog window I have used ( m_dUpdateDlg.DoModal (); ) code to open the 2nd window. From 2nd window when click on next window button it opens the 3rd window ( m_dStatusDlg.DoModal (); ) In this process all the 3 window will be open one above the other I want to know how close the 2nd dialog window then open the 3r d window.?? Please can anyone tell me how to close and then open other dialog window?? Regards, Parichay.
parichaybp wrote:
Please can anyone tell me how to close...dialog window??
To close a modal dialog, simply call
EndDialog()
.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb