CPropertyPage::SetModified
调用此成员函数来启用或禁用应用现在按,具体取决于是否应该应用在属性页上的设置在适当的外部对象。
void SetModified(
BOOL bChanged = TRUE
);
参数
- bChanged
指示的TRUE 属性页设置自上次修改后的应用;应忽略指示的 FALSE 应用了属性页设置或。
备注
结构记录哪些页是“已更新”,即调用 **SetModified( TRUE )**的属性页。 调用,则之一的 SetModified( TRUE ) 页,将按现在始终启用。 应用现在按将被禁用,调用之一的 SetModified( FALSE ) 页时,不过,只有当其他页都不是“已更新”。
示例
// 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