CRichEditCtrl::SetParaFormat

BOOL SetParaFormat( PARAFORMAT& pf );

Return Value

Nonzero if successful; otherwise, 0.

Parameters

pf

structure containing the new default paragraph formatting attributes.

Remarks

Call this function to set the paragraph formatting attributes for the current selection in this CRichEditCtrl object. Only the attributes specified by the dwMask member of pf are changed by this function.

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

Example

// The pointer to my rich edit control.
extern CRichEditCtrl* pmyRichEditCtrl;
PARAFORMAT pf;

// Modify the paragraph format so that the text is centered.
pf.cbSize = sizeof(PARAFORMAT);
pf.dwMask = PFM_ALIGNMENT;
pf.wAlignment = PFA_CENTER;
pmyRichEditCtrl->SetParaFormat(pf);

// Verify the settings are what is expected.
#ifdef _DEBUG
   pmyRichEditCtrl->GetParaFormat(pf);
   ASSERT(pf.dwMask&PFM_ALIGNMENT);
   ASSERT(pf.wAlignment == PFA_CENTER);
#endif

CRichEditCtrl OverviewClass MembersHierarchy Chart

See Also   CRichEditCtrl::GetParaFormat, CRichEditCtrl::SetSelectionCharFormat