我在一个程序中动态编写了一个控件CEdit m_Edit
请问用什么函数可以将一个变量与其相关联,这样我 
就可将该变量的内容在这个控件中显示了
如何编写动态编写控件(按钮)的clicked的事件多谢了!!!

解决方案 »

  1.   

    m_Edit.SetWindowText( ... );
      

  2.   

    按钮的click事件需要手动添加消息映射
      

  3.   

    .h afx_msg void OnButton1();
    .cpp
    BEGIN_MESSAGE_MAP(CRegeditDlg, CDialog)
    //{{AFX_MSG_MAP(CRegeditDlg)
    ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
    //}}AFX_MSG_MAP
    END_MESSAGE_MAP()void CRegeditDlg::OnButton1() 
    {
    // TODO: Add your control notification handler code here
    // TODO: Add your control notification handler code here
    //允许运行注册表
    }