다음을 통해 공유


CPropertyPage::OnCancel

취소 단추를 선택할 때이 멤버 함수는 프레임 워크에서 호출 됩니다.

virtual void OnCancel( );

설명

취소 단추를 작업을 수행 하려면이 멤버 함수를 재정의 합니다. 변경 된 기본을 부정 합니다.

예제

// Discard any selection the user made to this page.  The object 
// in the view will be painted with the initial color when the 
// CPropertySheet dialog is first shown. CColorPage is a  
// CPropertyPage-derived class. 
void CColorPage::OnCancel() 
{
   // Reset the color saved in the document class.  m_InitialColor 
   // is a member variable of CColorPage and it is the color shown  
   // in the view before CPropertySheet is shown. 
   // doc->m_Color is the color saved in the document class, and  
   // this is the color to be used by the view class.
   CMDIFrameWnd* pFrame = (CMDIFrameWnd*) AfxGetMainWnd();
   CMDIChildWnd* pChild = pFrame->MDIGetActive();
   CPSheetDoc* doc = (CPSheetDoc*) pChild->GetActiveDocument();
   doc->m_Color = m_InitialColor;

   // Tell the view to paint with the initial color.
   CView* view = pChild->GetActiveView();
   view->Invalidate();

   CPropertyPage::OnCancel();
}

// The default MFC implementation of OnReset() would call OnCancel(). 
void CColorPage::OnReset() 
{
   CPropertyPage::OnReset();
}

요구 사항

헤더: afxdlgs.h

참고 항목

참조

CPropertyPage 클래스

계층 구조 차트

CPropertyPage::OnApply

CDialog::OnCancel

CPropertyPage::OnOK