#include"Dialog2.h"
增加单击button消息响应函数(具体在资源中双击button即可)
在button的响应函数中添加代码:
//可用模态对话框和非模态对话框,也可以采用子对话框形式
CDialog2 * dlg ;
dlg = new CDialog2(this)
1.模态
dlg->Domodal();
2.非模态
dlg->Create(IDD_DIALOG2,this);
dlg->ShowWindow(sw_show);
3子对话框(这种不是弹出的那种,是放置在父对话框上,因此在对话框属性上把Popup改成child)
Crect rc;
GetClientRect(&rc);
dlg->Create(IDD_DIALOG2,this);
dlg->MoveWindow(&rc);
dlg->ShowWindow(sw_show);
MFC显示新窗口
最新推荐文章于 2025-05-24 10:04:50 发布