MFC删除Button控件具体操作

  1. 删除Button按键;
  2. 删除xxxDlg.h中消息映射函数定义
class Ctest4Dlg : public CDialogEx
{
	...
public:
	//afx_msg void OnBnClickedButton1();
	...
}
  1. 删除xxxDlg.cpp中“DoDataExchange”和“BEGIN_MESSAGE_MAP”中的相关代码
void CtestDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_COMBO1, m_combox1);
	DDX_Text(pDX, IDC_EDIT2, m_Edit2);
	//DDX_Control(pDX, IDC_BUTTON1, m_Button1);
	...
}
BEGIN_MESSAGE_MAP(Ctest4Dlg, CDialogEx)
	ON_WM_SYSCOMMAND()
	ON_WM_PAINT()
	ON_WM_QUERYDRAGICON()
	//ON_BN_CLICKED(IDC_BUTTON1, &Ctest4Dlg::OnBnClickedButton1)
	...
END_MESSAGE_MAP()
  1. 删除xxxDlg.cpp中按键响应函数
//void CtestDlg::OnBnClickedButton1()
//{
//    //TODO: 在此添加控件通知处理程序代码
//    ...
//}

你可能感兴趣的:(mfc,c++)