Click here to Skip to main content
16,004,833 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I know how to add PropertyPages in PropertySheet.
I know how to add controls to PropertyPages of a PropertySheet.
But i want to add controls to propertysheet,and those controls should be common for all propertyPages of propertySheet,like OK APPLY and CANCEL
Posted

1 solution

I can imagine the following way :) :
C++
class CYourSheet : public CPropertySheet
{
 CYourCtrl m_cCtrl;      // just a control, like CButton or CListCtrl
 CMyFrameWnd* m_pcFrame; // CFrameWnd-derivation does process delete this in OnDestroy()
//..
public:
  CYourSheet(..)
    : CPropertySheet(..)
    , m_cCtrl()
    , m_pcFrameCtrl(new CMyFrameWnd) {}
//..
protected:
  virtual BOOL OnInitDialog()
  {
    BOOL bResult(CPropertySheet::OnInitDialog());

    //..
    if (GetSafeHwnd()) {
      m_cCtrl.Create(..);    // a child, it will be destroyed automatically
      m_pcFrame->Create(..); // a child, it will be destroyed and deleted automatically
    }
    return bResult;
  }
//.. 
};
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900