千锤百炼VC++实例(连载9) 对话框的创建

来源:互联网 发布:腾讯php面试经历 编辑:程序博客网 时间:2024/04/29 18:58

孤狼工作室 Visual C++ 实例连载

实例9 对话框的创建

1.创建以对话框应用程序,工程名为:Dialog

2.在对话框中添加两个按钮,标题分别为:对话框、关于。

3.为这两个按钮添加鼠标单击响应事件

编辑代码如下:

void CDialogDlg::OnButton1()
{
 // TODO: Add your control notification handler code here
 MessageBox("对话框创建成功!");
 
}

void CDialogDlg::OnButton2()
{
 // TODO: Add your control notification handler code here
    CAboutDlg dlg;
 dlg.DoModal();

 
}

原创粉丝点击