使用MFC在一对话框中嵌入另一对话框

全文介绍如何使用MFC在一对话框中嵌入另一对话框.

代码如下:

static MyInDlg inDlg; // 需嵌入的对话框
inDlg.Create( IDD_DIALOG, AfxGetApp()->m_pMainWnd);
CRect rc; // 嵌入对话框在原对话框中的位置
//GetClientRect(&rc);
rc.left = 150;
rc.top = 0;
rc.bottom = 200;
rc.right = 350;
inDlg.MoveWindow( rc ); // 设置位置
inDlg.ShowWindow( SW_SHOW ); // 将对话框显示出来

对嵌入对话框设置如下:

Style: Child
Border: none

Eric Ma

Eric is a systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

Leave a Reply

Your email address will not be published. Required fields are marked *