CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 1999
    Location
    Bangalore, India
    Posts
    30

    CPropertySheet in Wizard Mode

    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

  2. #2
    Join Date
    Aug 1999
    Posts
    107

    Re: CPropertySheet in Wizard Mode

    use GetDlgItem(IDCANCEL) in the property sheet(not the page)to get a pointer to the cancel button and then call EnableWindow



  3. #3
    Join Date
    May 1999
    Location
    Bangalore, India
    Posts
    30

    Re: CPropertySheet in Wizard Mode

    Hi,

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

    Thanks a ton..


    With Regards,

    Anuj Seth

  4. #4
    Join Date
    Jun 1999
    Location
    San Diego, CA
    Posts
    600

    Re: CPropertySheet in Wizard Mode

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured