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
    Posts
    388

    PropertySheet: How to make the apply button work



    I have the followig code

    CPropertySheet sheet;

    CPage1 page1;

    CPage2 page;

    sheet.AddPage(&page1);

    sheet.AddPage(&page2);

    sheet.DoModal();

    it displays a propertysheet with ok,cancel, and apply button but the last button is not enables. How will I use the

    apply button?

  2. #2
    Join Date
    Apr 1999
    Location
    Miami, FL
    Posts
    67

    Re: PropertySheet: How to make the apply button work



    Take a look at the docs for CPropertyPage::SetModified().

  3. #3
    Join Date
    Apr 1999
    Posts
    16

    Re: PropertySheet: How to make the apply button work



    As Alvaro says you first have to enable the Apply button, to do this set

    CPropertyPage::SetModifed(TRUE)whenever the user changes anything in each of

    your property pages

    CmyPropertyPage ublic CPropertyPage {

    // ...

    protected:

    afx_msg void OnChange();

    //...}

    BEGIN_MESSAGE_MAP(CmyPropertyPage,CPropertyPage)

    ON_WHATEVER_CHANGES(/*what you change*/, OnChange)//call onchange when you

    //handle whatever changes in the property sheet

    END_MESSAGE_MAP

    void CmyPropertyPage::OnChange()

    {

    SetModified(TRUE);

    }

    Once enabled you must handle it by writing in your property sheet a handler

    for the BN_CLICKED message on the ID_APPLY_NOW, note that you only call

    UpdateData() for the active property page, the others are already updated by

    MFC. remember to update all views.

    Hey if all else fails you can always add m_psh.dwFlags |=PSH_NOAPPLYNOW;

    to your property sheet constructor. This hides the Apply button *grin*

  4. #4
    Join Date
    May 1999
    Posts
    388

    thankx



    thankx for the help

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