다음을 통해 공유


CPropertySheet::Create

모덜리스 속성 시트를 표시합니다.

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

매개 변수

  • pParentWnd
    부모 창 가리킵니다. 경우 NULL, 부모 바탕 화면입니다.

  • dwStyle
    속성 시트에 대 한 창 스타일입니다. 사용 가능한 스타일에 대 한 전체 목록을 참조 하십시오 창 스타일.

  • dwExStyle
    속성 시트에 대 한 확장된 창 스타일입니다. 사용 가능한 스타일에 대 한 전체 목록을 참조 하십시오 확장 창 스타일

반환 값

속성 시트를 성공적으로 만든 경우에 0이 아닌. 그렇지 않으면 0입니다.

설명

호출을 만들기 생성자 안에서 수 또는 생성자를 호출한 후 호출할 수 있습니다.

기본 스타일으로 전달 하는-1로 표현, dwStyle, 실제로 WS_SYSMENU | WS_POPUP | WS_CAPTION | DS_MODALFRAME | DS_CONTEXTHELP | WS_VISIBLE. 기본 확장 창 스타일을 표현으로 0을 전달 하 여 dwExStyle, 실제로 WS_EX_DLGMODALFRAME.

만들기 멤버 함수를 반환 하는 속성 시트를 만든 후 즉시. 속성 시트를 파괴 하려면 호출 CWnd::DestroyWindow.

모덜리스 속성 시트를 표시 합니다. 만들기 모달 속성 시트와 확인, 취소, 이제 적용 및 도움말 단추가 없습니다. 사용자가 원하는 단추를 만들어야 합니다.

모달 속성 시트를 표시 하려면 DoModal 대신 합니다.

예제

// This code fragment shows how to create a modeless property sheet  
// dialog in a command message handler (OnModelessPropertySheet())  
// of a CView-derived class. 
void CPSheetView::OnModelessPropertySheet()
{
   // Declare a CPropertySheet object.  m_pdlgPropertySheet is a data 
   // member of type CPropertySheet in CView-derived class.
   m_pdlgPropertySheet = new CPropertySheet(_T("Simple PropertySheet"));
   ASSERT(m_pdlgPropertySheet);

   // Add three pages to the CPropertySheet object.  Both m_pstylePage,  
   // m_pcolorPage, and m_pshapePage are data members of type  
   // CPropertyPage-derived classes in CView-derived class.
   m_pstylePage = new CStylePage;
   m_pcolorPage = new CColorPage;
   m_pshapePage = new CShapePage;
   m_pdlgPropertySheet->AddPage(m_pstylePage);
   m_pdlgPropertySheet->AddPage(m_pcolorPage);
   m_pdlgPropertySheet->AddPage(m_pshapePage);

   // Create a modeless CPropertySheet dialog.
   m_pdlgPropertySheet->Create(); 
}
// 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.
CPSheetView::~CPSheetView()
{
   delete m_pshapePage;
   delete m_pstylePage;
   delete m_pcolorPage;
   delete m_pdlgPropertySheet;
}

요구 사항

헤더: afxdlgs.h

참고 항목

참조

CPropertySheet 클래스

계층 구조 차트

CDialog::Create

CPropertySheet::DoModal