CRichEditCtrl::SetWordCharFormat

BOOL SetWordCharFormat( CHARFORMAT& cf );

Return Value

Nonzero if successful; otherwise, 0.

Parameters

cf

CHARFORMAT structure containing the new character formatting attributes for the currently selected word.

Remarks

Call this function to set the character formatting attributes for the currently selected word in this CRichEditCtrl object. Only the attributes specified by the dwMask member of cf are changed by this function.

For more information, see EM_SETCHARFORMAT message and CHARFORMAT structure in the Win32 documentation.

Example

// The pointer to my rich edit control.
extern CRichEditCtrl* pmyRichEditCtrl;
CHARFORMAT cf;

// Modify the word format so that the selected word is 
// displayed in bold and not striked out.
cf.dwMask = CFM_STRIKEOUT|CFM_BOLD;
cf.dwEffects = CFE_BOLD;
pmyRichEditCtrl->SetWordCharFormat(cf);

CRichEditCtrl OverviewClass MembersHierarchy Chart

See Also   CRichEditCtrl::SetSelectionCharFormat