CRichEditCtrl::SetSelectionCharFormat
문자 서식을 현재 선택 영역에서이 텍스트 특성 설정 CRichEditCtrl 개체입니다.
BOOL SetSelectionCharFormat(
CHARFORMAT& cf
);
BOOL SetSelectionCharFormat(
CHARFORMAT2& cf
);
매개 변수
cf
첫 번째 버전에 대 한 포인터는 CHARFORMAT 새 문자 서식을 포함 하는 구조에 현재 선택 영역에 대 한 특성.두 번째 버전에 대 한 포인터는 CHARFORMAT2 서식 있는 편집 2.0 확장 된 구조에는 CHARFORMAT 새 문자 서식을 현재 선택 영역에 대 한 특성을 포함 하는 구조를.
반환 값
성공 하면 0이 아닌. 그렇지 않으면 0입니다.
설명
지정 된 특성만 dwMask 소속 cf 이 함수에 의해 변경 됩니다.
자세한 내용은 EM_SETCHARFORMAT , CHARFORMAT 및 CHARFORMAT2 구조에 Windows SDK.
예제
CHARFORMAT cf;
// Modify the selection format so that the selected text is
// displayed in bold and not striked out.
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_STRIKEOUT|CFM_BOLD;
cf.dwEffects = CFE_BOLD;
m_myRichEditCtrl.SetSelectionCharFormat(cf);
// Verify the settings are what is expected.
m_myRichEditCtrl.GetSelectionCharFormat(cf);
ASSERT((cf.dwMask&(CFM_STRIKEOUT|CFM_BOLD)) ==
(CFM_STRIKEOUT|CFM_BOLD));
ASSERT((cf.dwEffects&(CFE_STRIKEOUT|CFE_BOLD)) == CFE_BOLD);
요구 사항
헤더: afxcmn.h