Aracılığıyla paylaş


CPropertyPage::OnOK

Kullanıcı framework aramaları hemen sonra Tamam'ı veya şimdi Uygula düğmesini seçtiğinde çerçevesi tarafından bu üye işlevi çağrılır OnKillActive.

virtual void OnOK( );

Notlar

Kullanıcı Tamam'ı veya şimdi Uygula düğmesini seçtiğinde framework alır psn_apply bildirim özellik sayfasından.Çağrı OnOK çağırırsanız, yapılan olmaz CPropertySheet::PressButton çünkü özellik sayfası bildirimi durumda göndermez.

Tüm özellik sayfası kullanıcı terkeder, şu anda etkin sayfaya özgü ek davranışı uygulamak için bu üye işlevi geçersiz kılar.

Bu üye işlevi varsayılan uygulama sayfası, veri içinde güncelleştirildiği yansıtmak için "temiz" olarak işaretler OnKillActive işlevi.

Örnek

// Accept the new color selection and dismiss the CPropertySheet
// dialog. The view's object will be painted with the new selected
// color. CColorPage is a CPropertyPage-derived class.
void CColorPage::OnOK() 
{
   // Store the new selected color to a member variable of 
   // document class.  m_Color is a member varible of CColorPage 
   // and it stores the new selected color.  doc->m_Color is 
   // the color saved in the document class and it is the color 
   // used by the view class.
   CMDIFrameWnd* pframe = (CMDIFrameWnd*) AfxGetMainWnd();
   CMDIChildWnd* pchild = pframe->MDIGetActive();
   CPSheetDoc* doc = (CPSheetDoc*) pchild->GetActiveDocument();
   doc->m_Color = m_Color;

   // Tell the view to paint with the new selected color.
   CView* view = pchild->GetActiveView();
   view->Invalidate();

   CPropertyPage::OnOK();
}

// The default MFC implementation of OnApply() would call OnOK().
BOOL CColorPage::OnApply() 
{
   return CPropertyPage::OnApply();
}

Gereksinimler

Başlık: afxdlgs.h

Ayrıca bkz.

Başvuru

CPropertyPage sınıfı

Hiyerarşi grafik

CDialog::OnOK

CPropertyPage::OnKillActive