拆分器窗格上禁用所有控件

时间:2012-02-08 21:46:23

标签: visual-studio mfc csplitterwnd

在我的MFC应用程序中,我使用CSplitterWnd创建了两个窗格,每个窗格都是一个CFormView对话框。运行此GUI应用程序时,拆分器正在运行,两个窗格都显示,但所有控件(按钮,编辑框,组合框...)都被禁用。两个对话框都具有“child”和“no border”属性。

我是否错过了在窗格视图中启用所有这些控件的内容?

非常感谢您的帮助。

CK

/////////// Header file
class CParentSelectionDlg : public CFormView
{
protected:
    CParentSelectionDlg();           // protected constructor used by dynamic creation
    DECLARE_DYNCREATE(CParentSelectionDlg)

// Form Data
public:
    //{{AFX_DATA(CParentSelectionDlg)
    enum { IDD = IDD_PARENT_SELECTION };
        // NOTE: the ClassWizard will add data members here
    //}}AFX_DATA

// Attributes
public:

// Operations
public:

// Overrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CParentSelectionDlg)
    public:
    virtual void OnInitialUpdate(); 
    protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
    //}}AFX_VIRTUAL

// Implementation
protected:
    virtual ~CParentSelectionDlg();
#ifdef _DEBUG
    virtual void AssertValid() const;
    virtual void Dump(CDumpContext& dc) const;
#endif

    // Generated message map functions
    //{{AFX_MSG(CParentSelectionDlg)
    afx_msg void OnButtonSave();
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()
};


/////////////////////////////// CPP

IMPLEMENT_DYNCREATE(CParentSelectionDlg, CFormView)

CParentSelectionDlg::CParentSelectionDlg()
    : CFormView(CParentSelectionDlg::IDD)
{
    //{{AFX_DATA_INIT(CParentSelectionDlg)
        // NOTE: the ClassWizard will add member initialization here
    //}}AFX_DATA_INIT
}

CParentSelectionDlg::~CParentSelectionDlg()
{
}

void CParentSelectionDlg::DoDataExchange(CDataExchange* pDX)
{
    CFormView::DoDataExchange(pDX);
    //{{AFX_DATA_MAP(CParentSelectionDlg)
        // NOTE: the ClassWizard will add DDX and DDV calls here
    //}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CParentSelectionDlg, CFormView)
    //{{AFX_MSG_MAP(CParentSelectionDlg)
    ON_BN_CLICKED(IDC_BUTTON_SAVE, OnButtonSave)
    //}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CParentSelectionDlg diagnostics

#ifdef _DEBUG
void CParentSelectionDlg::AssertValid() const
{
    CFormView::AssertValid();
}

void CParentSelectionDlg::Dump(CDumpContext& dc) const
{
    CFormView::Dump(dc);
}
#endif //_DEBUG

void CParentSelectionDlg::OnInitialUpdate() 
{
    CFormView::OnInitialUpdate();

}


/////////////////////////////////////////////////////////////////////////////
// CParentSelectionDlg message handlers

void CParentSelectionDlg::OnButtonSave() 
{
    // TODO: Add your control notification handler code here

}
/// Thanks a lot

1 个答案:

答案 0 :(得分:1)

我打赌你的message map设置不正确。

你可以发布你的代码吗?