CPropertyPage::OnCancel

virtual void OnCancel( );

Remarks

This member function is called by the framework when the Cancel button is selected. Override this member function to perform Cancel button actions. The default negates any changes that have been made.

Example

// 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.
   CFrameWnd* frame = (CFrameWnd*) AfxGetMainWnd();
   CPSheetDoc* doc = (CPSheetDoc*) frame->GetActiveDocument();
   doc->m_Color = m_InitialColor;

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

   CPropertyPage::OnCancel();
}

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

CPropertyPage OverviewClass MembersHierarchy Chart

See Also   CPropertyPage::OnApply, CDialog::OnCancel, CPropertyPage::OnOK