将控件添加到PropertySheet而不添加到PropertyPage [英] adding controls to PropertySheet not to PropertyPage

查看:91
本文介绍了将控件添加到PropertySheet而不添加到PropertyPage的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何在PropertySheet中添加PropertyPages.
我知道如何向PropertySheet的PropertyPages添加控件.
但是我想将控件添加到属性表,并且这些控件应该对propertySheet的所有propertyPages都是通用的,例如OK APPLY和CANCEL

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

推荐答案

我可以想象以下方式: ):
I can imagine the following way :) :
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;
  }
//.. 
};


这篇关于将控件添加到PropertySheet而不添加到PropertyPage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆