C++学习笔记3—对话框

时间:2023-03-08 17:56:31

1、模态对话框

CTipDlg tipDlg;
 INT_PTR nResponse = tipDlg.DoModal();
 if(nResponse == IDCANCEL)
 {
  return;
 }

UpdateData(TRUE);
 m_editsum = m_editAddend+m_editSummand;
 UpdateData(FALSE);

2、非模态对话框

#include "TipDlg.h"

CTipDlg *m_pTipDlg;

m_pTipDlg = new CTipDlg();
m_pTipDlg->Create(IDD_TIP_DIALOG,this);
m_pTipDlg->ShowWindow(SW_SHOW);