This documentation is archived and is not being maintained.


Displays a modeless property sheet.

virtual BOOL Create(
   CWnd* pParentWnd = NULL,
   DWORD dwStyle = (DWORD)–1,
   DWORD dwExStyle = 0 



Points to parent window. If NULL, parent is the desktop.


Window styles for property sheet. For a complete list of available styles, see Window Styles.


Extended window styles for property sheet. For a complete list of available styles, see Extended Window Styles

Nonzero if the property sheet is created successfully; otherwise 0.

The call to Create can be inside the constructor, or you can call it after the constructor is invoked.

The default style, expressed by passing –1 as dwStyle, is actually WS_SYSMENU | WS_POPUP | WS_CAPTION | DS_MODALFRAME | DS_CONTEXTHELP | WS_VISIBLE. The default extended window style, expressed by passing 0 as dwExStyle, is actually WS_EX_DLGMODALFRAME.

The Create member function returns immediately after creating the property sheet. To destroy the property sheet, call CWnd::DestroyWindow.

Modeless property sheets displayed with a call to Create do not have OK, Cancel, Apply Now, and Help buttons as modal property sheets do. Desired buttons must be created by the user.

To display a modal property sheet, call DoModal instead.

// This code fragment shows how to create a modeless property sheet 
// dialog in a command message handler (OnModelessPropertySheet()) 
// of a CView-derived class.

void CMyView::OnModelessPropertySheet() 
   // Declare a CPropertySheet object.  m_dlgPropertySheet is a data
   // member of type CPropertySheet in CView-derived class.
   m_dlgPropertySheet = new CPropertySheet("Simple PropertySheet");

   // Add two pages to the CPropertySheet object.  Both m_stylePage and
   // m_colorPage are data members of type CPropertyPage-derived classes
   // in CView-derived class.
   m_stylePage = new CStylePage;
   m_colorPage = new CColorPage;

   // Create a modeless CPropertySheet dialog.

// The code fragment below shows how to destroy the C++ objects for
// propertysheet and propertypage in the destructor of CView-derived
// class.
// NOTE:  DestroyWindow() is called in CPropertySheet::OnClose() so
// you do not need to call it here.  Property pages are children
// of the CPropertySheet, they will be destroyed by their parents.

   if (m_dlgPropertySheet)
      delete m_stylePage;
      delete m_colorPage;
      delete m_dlgPropertySheet;