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


CRichEditView::SetCharFormat

Call this function to set the character formatting attributes for new text in this CRichEditView object.

void SetCharFormat(
   CHARFORMAT2 cf 
);

Параметры

  • cf
    CHARFORMAT2 structure containing the new default character formatting attributes.

Заметки

Only the attributes specified by the dwMask member of cf are changed by this function.

For more information, see EM_SETCHARFORMAT message and CHARFORMAT2 structure in the Windows SDK.

Пример

void CMyRichEditView::OnCharUnderline ()
{
    CHARFORMAT2 cf;
    cf = GetCharFormatSelection();

    if (!(cf.dwMask & CFM_UNDERLINE) || !(cf.dwEffects & CFE_UNDERLINE))
        cf.dwEffects = CFE_UNDERLINE;
    else
        cf.dwEffects = 0;

    cf.dwMask = CFM_UNDERLINE;
    SetCharFormat(cf);
}

Требования

Header: afxrich.h

См. также

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

CRichEditView Class

CRichEditView Members

Hierarchy Chart

CRichEditView::GetCharFormatSelection

CRichEditView::SetParaFormat