Visual C++ and MFC Fundamentals Chapter 12: Dialog-Based Windows
*/
CFloatingSheet::CFloatingSheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT
iSelectPage)
:CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{
AddPage(&pgSmall);
AddPage(&pgMedium);
}CFloatingSheet::~CFloatingSheet()
{
}BEGIN_MESSAGE_MAP(CFloatingSheet, CPropertySheet)
ON_WM_CLOSE()
END_MESSAGE_MAP()// CFloatingSheet message handlersvoid CFloatingSheet::OnClose()
{
// TODO: Add your message handler code here and/or call default
ShowWindow(FALSE);// CPropertySheet::OnClose();
}- Display the IDR_MAINFRAME menu and, under the Floater menu item of the View
menu, add a new item with a caption of Fl&oating and press Enter - Right-click the Floating menu item and click Add Event Handler...
- Accept the Message type as COMMAND. Accept the suggested Function Handler
Name. In the Class List, click CMainFrame then click Add and Edit - Access the MainFrm.h header file. Then, declare a pointer to the property sheet class
and name it Fsheet:
// MainFrm.h : interface of the CMainFrame class
//
#pragma once
#include "FloaterDlg.h"
#include "FoatingSheet.h"class CMainFrame : public CFrameWnd
{protected: // create from serialization only
CMainFrame();
DECLARE_DYNCREATE(CMainFrame)// Attributes
public:// Operations
public:
CFloaterDlg *Floater;
CFloatingSheet *FSheet;