共用方式為


CPropertyPage::SetModified

呼叫此成員函式來啟用或停用套用出現在按鈕,根據是否應套用在屬性頁上的設定為適當的外部物件。

void SetModified(
   BOOL bChanged = TRUE 
);

參數

  • bChanged
    表示的 屬性頁設定上次修改這些限制,應該忽略指示的 屬性頁設定套用或。

備註

框架記錄哪些頁面「dirty」,也就是您呼叫 **SetModified( TRUE )**的屬性頁。 如果您呼叫其中一個 SetModified( TRUE ) 的頁面,將出現在 [永遠會啟用。 套用出現在按鈕都會停用,當您呼叫其中一個 SetModified( FALSE ) 網頁時,,不過,只有在其他頁面都是「變更 (Dirty)」。

範例

// OnColorClicked() is a member function of CColorPage (a
// CPropertyPage-derived class). It is called whenever a radio button
// is selected on the page. Call SetModified() to enable the Apply 
// button whenever a new selection is made. m_Color is a member
// variable of CColorPage and it is to store the selected RGB color.
// Its entry in the message map looks like this:
// ON_CONTROL_RANGE(BN_CLICKED, IDC_BLACK, IDC_GREEN, CColorPage::OnColorClicked)
void CColorPage::OnColorClicked(UINT nCmdID)
{
   COLORREF color = m_Color;
   switch (nCmdID)
   {
   case IDC_RADIOBLACK:
      color = RGB(0, 0, 0);
      m_radioColor = crBlack;
      break;

   case IDC_RADIORED:
      color = RGB(255, 0, 0);
      m_radioColor = crRed;
      break;

   case IDC_RADIOGREEN:
      color = RGB(0, 255, 0);
      m_radioColor = crGreen;
      break;

   case IDC_RADIOBLUE:
      color = RGB(0, 0, 255);
      m_radioColor = crBlue;
      break;
   }

   if (color != m_Color)
   {
      m_Color = color;
      SetModified();    // Enable Apply Now button.
   }

   UpdateData(FALSE);
}

需求

Header: afxdlgs.h

請參閱

參考

CPropertyPage 類別

階層架構圖

CPropertyPage::CancelToClose