wizard finish button and message box
-
I have a property sheet with wizard style. At one place, I need to disable the Finish button. The code doesn't work and the Finish button is enabled. But if I put a message box before calling the SetWizardButton routine, it works. I tried with invalidate method so as to refresh the current windows, but I guess I am missing something. Any pointers? evil triumphs when good people sit quiet..
-
I have a property sheet with wizard style. At one place, I need to disable the Finish button. The code doesn't work and the Finish button is enabled. But if I put a message box before calling the SetWizardButton routine, it works. I tried with invalidate method so as to refresh the current windows, but I guess I am missing something. Any pointers? evil triumphs when good people sit quiet..
misha_grewal wrote:
The code doesn't work and the Finish button is enabled.
What does the code look like?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
misha_grewal wrote:
The code doesn't work and the Finish button is enabled.
What does the code look like?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
oK I digged into the problem a little bit Is it a message queue problem? Code === pWizard->SetWizardButtons(PSWIZB_BACK); CWnd* pButton = pWizard->GetDlgItem(ID_WIZFINISH); if (pButton) { // this call doesn't work pButton->EnableWindow(FALSE); } but if you put a message box before the call, it works, as in if (pButton) { AfxMessageBox(_T("text")); // this call now WORKS pButton->EnableWindow(FALSE); } Code ends == On the other hand, if I call a "ShowWindow" method instead of EnableWindow, it works fine with or without the message box. What happens in EnableWindow?
-
oK I digged into the problem a little bit Is it a message queue problem? Code === pWizard->SetWizardButtons(PSWIZB_BACK); CWnd* pButton = pWizard->GetDlgItem(ID_WIZFINISH); if (pButton) { // this call doesn't work pButton->EnableWindow(FALSE); } but if you put a message box before the call, it works, as in if (pButton) { AfxMessageBox(_T("text")); // this call now WORKS pButton->EnableWindow(FALSE); } Code ends == On the other hand, if I call a "ShowWindow" method instead of EnableWindow, it works fine with or without the message box. What happens in EnableWindow?
misha_grewal wrote:
CWnd* pButton = pWizard->GetDlgItem(ID_WIZFINISH); if (pButton) { // this call doesn't work pButton->EnableWindow(FALSE);
Why aren't you using:
pWizard->SetWizardButtons(PSWIZB_DISABLEDFINISH);
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
misha_grewal wrote:
CWnd* pButton = pWizard->GetDlgItem(ID_WIZFINISH); if (pButton) { // this call doesn't work pButton->EnableWindow(FALSE);
Why aren't you using:
pWizard->SetWizardButtons(PSWIZB_DISABLEDFINISH);
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
Thanks much it works with this call i m really stupid