1

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

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

非常感谢您的帮助。

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
4

1 回答 1

1

我敢打赌您的消息映射设置不正确。

你可以发布你的代码吗?

于 2012-02-08T22:07:09.883 回答