Поделиться через


CPropertyPage::OnQueryCancel

This member function is called by the framework when the user clicks the Cancel button and before the cancel action has taken place.

virtual BOOL OnQueryCancel( );

Возвращаемое значение

Returns FALSE to prevent the cancel operation or TRUE to allow it.

Заметки

Override this member function to specify an action the program takes when the user clicks the Cancel button.

The default implementation of OnQueryCancel returns TRUE.

Пример

// Query the user whether to abort the changes if the new selected
// color (m_Color) is different from the initial color 
// (m_InitialColor) when the CPropertySheet dialog is first shown.
// CColorPage is a CPropertyPage-derived class.
BOOL CColorPage::OnQueryCancel() 
{
   if (m_InitialColor != m_Color)
   {
      if (AfxMessageBox(_T("Abort the changes?"), MB_YESNO) == IDNO)
         return FALSE;  
   }

   return CPropertyPage::OnQueryCancel();
}

Требования

Header: afxdlgs.h

См. также

Основные понятия

CPropertyPage Class

CPropertyPage Members

Hierarchy Chart