Export (0) Print
Expand All
Expand Minimize

CRichEditCtrl::SetRect

Sets the formatting rectangle for this CRichEditCtrl object.

void SetRect( 
   LPCRECT lpRect  
);

lpRect

CRect or pointer to a RECT that indicates the new bounds for the formatting rectangle.

The formatting rectangle is the limiting rectangle for the text. The limiting rectangle is independent of the size of the rich edit control window. When this CRichEditCtrl object is first created, the formatting rectangle is the same size as the client area of the window. Use SetRect to make the formatting rectangle larger or smaller than the rich edit window.

For more information, see EM_SETRECT in the Windows SDK.

CRect r;

m_myRichEditCtrl.GetRect(&r);

// Reduce the formatting rect of the rich edit control by 
// 10 pixels on each side. 
if ((r.Width() > 20) && (r.Height() > 20))
{
   r.DeflateRect(0, 20);
   m_myRichEditCtrl.SetRect(&r);
}

Header: afxcmn.h

Show:
© 2014 Microsoft