大侠快来帮忙!是这样的。
我的界面要在很多formview视图间切换,这个功能已经实现了。
现在的问题是其中一个formview视图要使用propertysheet和propertypage
对话框。
那么如何把这些对话框都嵌入在formview视图中呢?我用笨办法,DoModal(),视图叠在一起,界面很难看,要哭。
如果能把它们嵌在formview里,就好象formview中的控件那样就好了。提醒:我切换到别的formview后,再切换回这个formview界面必须也是这种
嵌入的样式。大家教教小弟吧,编译通过马上给分!

解决方案 »

  1.   

    在FormView的初始化函数中动态创建属性页窗体 使属性页窗口的父指针 是 formview的句柄即可
      

  2.   

    你看一下下面这段程序:
    class CSnapView : public CFormView
    {
    protected: 
    CSnapView();
    DECLARE_DYNCREATE(CSnapView)public:
    //{{AFX_DATA(CSnapView)
    // NOTE: the ClassWizard will add data members here
    //}}AFX_DATA
    public:
    CSnapDoc* GetDocument();
    public: //{{AFX_VIRTUAL(CSnapView)
    public:
    virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
    virtual void OnInitialUpdate();
    protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
    //}}AFX_VIRTUAL
    public:
    virtual ~CSnapView();
    #ifdef _DEBUG
    virtual void AssertValid() const;
    virtual void Dump(CDumpContext& dc) const;
    #endifprotected:
    // 跟踪父窗口的大小是否适合
    BOOL m_bSizedBefore; CPropertySheet* m_pPropSheet; // 在FORMVIEW中使用的三个属性页
    // 使用OnInitDialog
    CPropertyPage* m_pPageBkfst;
    CPropertyPage* m_pPageLunch;
    CPropertyPage* m_pPageDinner; afx_msg BOOL OnEraseBkgnd(CDC* pDC);
    afx_msg void OnDraw(CDC* pDC);// 普通的映射函数
    protected:
    //{{AFX_MSG(CSnapView)
    afx_msg void OnSize(UINT nType, int cx, int cy);
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()
    };BOOL CSnapView::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName,
    DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
    {
    ASSERT(pParentWnd != NULL);
    ASSERT_KINDOF(CFrameWnd, pParentWnd); if (!CWnd::Create(lpszClassName, lpszWindowName, dwStyle | WS_CLIPCHILDREN,
    rect, pParentWnd, nID, pContext))
    {
    return FALSE;
    } m_pPageBkfst = new CBkfstPage;
    m_pPageLunch = new CLunchPage;
    m_pPageDinner = new CDinnerPage; m_pPropSheet = new CSnapPropertySheet;
    m_pPropSheet->AddPage(m_pPageBkfst);
    m_pPropSheet->AddPage(m_pPageLunch);
    m_pPropSheet->AddPage(m_pPageDinner); if (!m_pPropSheet->Create(this,
    DS_CONTEXTHELP | DS_SETFONT | WS_CHILD | WS_VISIBLE))
    {
    DestroyWindow();
    return FALSE;
    } m_pPropSheet->SetWindowPos(NULL, 0, 0, 0, 0,
    SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE); m_pPropSheet->ModifyStyle(WS_BORDER|WS_CAPTION,
    dwStyle & (WS_BORDER|WS_CAPTION)); CFrameWnd* pParentFrame = GetParentFrame();
    CRect rectSize;
    m_pPropSheet->GetWindowRect(rectSize);
    pParentFrame->CalcWindowRect(rectSize);
    OnSize(SIZE_RESTORED, rectSize.Width(), rectSize.Height()); return TRUE;
    }
      

  3.   

    CYourfrmView::OnInitDialog()
    {
      ...
      m_dlgYourdlg.create(...
      m_dlgYourdlg.ShowWindow(SW_SHOW);
      ...
      

  4.   

    感谢pscqll,已经解决了。
    qrlvls的方法简单,但在切换时就不管用了。
    感谢大家。