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

    Wizard (PropertySheet)

    Hello,
    I am Working in VC++ Project, New to VC++, My Problem is
    I have created a Wizard using CPropertySheet, it is having 8 Pages, It is working fine. My problem is

    1) I want to Skip 5th page depending on the checkbutton is checked which is on the 4 th Page. and also when user presses Back on the 6th Page then 4th Page should be activated.

    2) I want to set the Caption for perticular page at runtime. I used SetWindowText("Caption");

    , Its not working
    Please Kindly help me.

    Kishore Kumar D
    Mail ID : [email protected]
    Bangalore.
    India.

  2. #2

    Re: Wizard (PropertySheet)

    Hi,

    To skip a page, you could try the following:

    1. Overide OnWizardNext in Page 4 property page.
    2. If your checkbutton is checked:

    CPropertySheet *pParent = (CPropertySheet *)GetParent();

    if(pParent)
    pParent->SetActivePage(5); //might be 6 (0 based?)




    Hope this helps,

    Simon


  3. #3
    Guest

    Re: Wizard (PropertySheet)

    I had the same problem and I wanted to get other buttons and a picture on this Wizard... so I created a CDialog object and on it a CPropertySheet object (see http://www.codeguru.com/propertyshee...e_dialog.shtml). Now everything works fine.. I've the pages of the CPropertySheet and by the functions of the CDialog I can select every page I want... (not only from 1 to 2 ...)


  4. #4
    Join Date
    May 1999
    Location
    Bangalore,India
    Posts
    18

    Re: Wizard (PropertySheet)

    Hello Simon Rose,
    Thanks for helping, but You have answered only the First Part. Please answer the second Part. I am specifying the problem clearly below :

    In Wizard I want to Take the details for n number of customers ( n < 4). I am using four Instances of same PropertyPage class. I want to set the Caption for each page at runtime in the event OnSetActive();

    depending on the instance of customer. I used SetWindowText(str) ;

    in OnSetActive();

    its not working.
    please help me.




    Kishore Kumar D
    Bangalore.
    India.

  5. #5

    Re: Wizard (PropertySheet)

    Hi,

    I have looked into a few ways of doing caption changing, none of which seem to work, so I'm not sure how it's done, sorry. I am sure it must be possible though.

    I tried in OnSetActive of the property page:

    CPropertySheet *pParent = (CPropertySheet *)GetParent();
    pParent->SetTitle(blahdy blah);



    and

    m_psh.dwFlags |= PSH_USETITLE;
    m_psh.pszTitle = blahdy blah;



    but all to no avail, so I am stumped.

    Sorry,

    Simon


  6. #6
    Join Date
    May 1999
    Location
    Bangalore,India
    Posts
    18

    Re: Wizard (PropertySheet)

    Hello Simon,
    Thanks for reply.But in the code m_psh.dwFlags |= PSH_USETITLE;
    m_psh.pszTitle = "Hello" ;

    VC++ 6.0 Compiler is returning an error saying that PSH_USETITLE is undefined. and also pszTitle is not a member of m_psh, but I found pszCaption. Please reply.

    Kishore

    Kishore Kumar D
    Bangalore.
    India.

  7. #7

    Re: Wizard (PropertySheet)

    Hi,

    Sorry for the typo, my fault. Of course, I assume you are placing this code in your Property Page class(es). The actual code would want to be:

    m_psp.dwFlags = PSP_USETITLE;
    m_psp.pszTitle = "Hello";



    When I tried this code though, it didn't work, but it's worth a try.

    If you want to do it from the property sheet, in that class, you could try:

    m_psh.pszCaption = "Hello";




    Hope this helps,

    Simon


  8. #8

    Re: Wizard (PropertySheet)

    Hi,

    By the way, there is a better, more robust way to skip a page. Overiding OnWizardNext in the property page with the check button, simply do:

    if(yourcheckbutton == true)
    return RESOURCE_ID_OF_DIALOG_TEMPLATE_TO_SKIP_TO;
    else
    return CPropertyPage::OnWizardNext();



    This works for going back too.

    Simon


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