readme.wzd

来自「MFC扩展编程实例」· WZD 代码 · 共 47 行

WZD
47
字号
/////////////////////////////////////////////////////////////////////
// Add a Child Dialog to a Dialog Box...
/////////////////////////////////////////////////////////////////////

// 1) Use the Dialog Editor to create a dialog template for each child
// dialog. Give them properties of Child and no border.
//
// 2) Use the ClassWizard to create a dialog class for each template.
//
// 3) Embed these child dialog classes in the parent dialog class:

		CWzdDialog1 m_wzd1;
		CWzdDialog2 m_wzd2;
			:	:

// 4) Add a static control to the parent dialog's template with the
// size and position where you want the child dialogs to appear.

// 5) Add a WM_INITDIALOG message handler to the parent dialog and
// get the rectangle of this static control:

	CRect rect;
	m_ctrlStatic.GetWindowRect(&rect);
	ScreenToClient(&rect);

// 6) Next in the same handler, create the child dialog boxes and
// position them all over the same static control making sure only 
// one is visible:

	m_dlg1.Create(IDD_DIALOG2,this);
	m_dlg1.ShowWindow(SW_SHOW);
	m_dlg1.MoveWindow(&rect);

	m_dlg2.Create(IDD_DIALOG3,this);
	m_dlg2.ShowWindow(SW_HIDE);
	m_dlg2.MoveWindow(&rect);

// 7) Based on some other control, change which child dialog is visible.

// 8) Process commands from these child dialogs in their own classes.

/////////////////////////////////////////////////////////////////////
// From: Visual C++ MFC Programming by Example by John E. Swanke
// Copyright (C) 1999 jeswanke. All rights reserved.
/////////////////////////////////////////////////////////////////////

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?