Click to See Complete Forum and Search --> : CPropertySheet in Wizard Mode


Anuj Seth
September 29th, 1999, 01:53 AM
Env: VC++ 6.0

Hi,

I've created a wizard based application using the CPropertySheet class. The wizard has a total of 8 pages/steps. The 7th page is totally "automated" and the user does not have to do anything. In other words, when the user clicks "Next" on page 6, the 7th page does something and then automatically goes to the 8th page.

I've been able to figure out how to switch pages. I used SetActivePage for that. I managed to disable the "Back" button on page 7 using

((CWizard *)GetParent())->SetWizardButtons(~PSWIZB_BACK);



in the OnInitDialog of page 7.

How do I disable the Next button? (I want both the Back and Next buttons disabled on Page 7)

On the last page, I've changed "Next" to "Finish" and disabled "Back". How do I disable "Cancel"?

Awaiting an early response,

With Regards,
Anuj

With Regards,

Anuj Seth

CJE
September 29th, 1999, 12:30 PM
use GetDlgItem(IDCANCEL) in the property sheet(not the page)to get a pointer to the cancel button and then call EnableWindow

Anuj Seth
September 29th, 1999, 11:20 PM
Hi,

Thanks for the reply! I was using GetDlgItem, but on the page and not the sheet!

Thanks a ton..


With Regards,

Anuj Seth

Anthony Mai
September 30th, 1999, 02:06 PM
You are almost there. But by using ~PSWIZB_BACK you enabled all buttons except the BACK.

Do this:

((CWizard *)GetParent())->SetWizardButtons(PSWIZB_BACK); // Show BACK button
((CWizard *)GetParent())->SetWizardButtons(PSWIZB_NEXT); // Show NEXT button
((CWizard *)GetParent())->SetWizardButtons(PSWIZB_BACK | PSWIZB_NEXT); // Show BACK and NEXT
((CWizard *)GetParent())->SetWizardButtons(0); // Show none of them






Hope that helps.



I hate fat programs as much as I hate being fat myself. I am lean and mean and so is my program.