SetDefaultCharFormat
Sets the current default character formatting attributes in this RichEdit control.
BOOL SetDefaultCharFormat( CHARFORMAT & cf )
Nonzero if successful; otherwise, 0.
EX1
#include <..\OriginLab\DialogEx.h> #define IDC_RICHEDIT1 1001 void RichEdit_SetDefaultCharFormat(Dialog& EditBoxes) { RichEdit richEdit = EditBoxes.GetItem(IDC_RICHEDIT1); CHARFORMAT cf; cf.dwEffects = CFE_BOLD; cf.dwMask = CFM_STRIKEOUT|CFM_BOLD; richEdit.SetDefaultCharFormat(cf); CHARFORMAT cfResult; richEdit.GetDefaultCharFormat(cfResult); ASSERT((cfResult.dwMask&(CFM_STRIKEOUT|CFM_BOLD)) == (CFM_STRIKEOUT|CFM_BOLD)); ASSERT((cfResult.dwEffects & (CFE_STRIKEOUT|CFE_BOLD) ) == CFE_BOLD); }
RichEdit::GetDefaultCharFormat
Control.h