|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
Sets 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 the EM_SETPARAFORMAT message and the PARAFORMAT and PARAFORMAT2 structures in the Windows SDK.
PARAFORMAT pf; // Modify the paragraph format so that the text is centered. pf.cbSize = sizeof(PARAFORMAT); pf.dwMask = PFM_ALIGNMENT; pf.wAlignment = PFA_CENTER; m_myRichEditCtrl.SetParaFormat(pf); // Verify the settings are what is expected. m_myRichEditCtrl.GetParaFormat(pf); ASSERT(pf.dwMask&PFM_ALIGNMENT); ASSERT(pf.wAlignment == PFA_CENTER);