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


CRichEditView::GetCharFormatSelection

Call this function to get the character formatting attributes of the current selection.

CHARFORMAT2& GetCharFormatSelection( );

Возвращаемое значение

A CHARFORMAT2 structure which contains the character formatting attributes of the current selection.

Заметки

For more information, see the EM_GETCHARFORMAT message and the 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::SetCharFormat

CRichEditView::GetParaFormatSelection

CRichEditCtrl::GetSelectionCharFormat