2.2.6.27.24 RichEdit::SetDefaultCharFormat

Description

Sets the current default character formatting attributes in this RichEdit control.

Syntax

BOOL SetDefaultCharFormat( CHARFORMAT & cf )

Parameters

cf
CHARFORMAT structure containing the new default character formatting attributes.

Return

Nonzero if successful; otherwise, 0.

Examples

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);
}

Remark

See Also

RichEdit::GetDefaultCharFormat

Header to Include

Control.h