次の方法で共有


CPropertyPage::OnQueryCancel

このメンバー関数は、フレームワークによってユーザーが[キャンセル]をクリックすると、取り消し操作が発生する前に呼び出されます。

virtual BOOL OnQueryCancel( );

戻り値

取り消し処理を妨げること、またはを許可するように調整する FALSE 返します。

解説

ユーザーが[キャンセル]をクリックするとプログラムが実行するアクションを指定するには、このメンバー関数をオーバーライドします。

OnQueryCancel を返します **[真]**の既定の実装。

使用例

// 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();
}

必要条件

ヘッダー : afxdlgs.h

参照

関連項目

CPropertyPage クラス

階層図