CRichEditCtrl::SetRect

将此 CRichEditCtrl 对象的格式矩形。

void SetRect(
   LPCRECT lpRect 
);

参数

  • lpRect
    指示新的区域设置矩形的CRect 或指针 RECT

备注

设置矩形是该文本的边框。 边框属于范围的独立的rich edit控件的窗口。 在此 CRichEditCtrl 对象首次创建时,设置矩形大小相同类似于窗口的工作区。 使用 SetRect 使格式化矩形大或小于rich edit窗口。

有关更多信息,请参见 Windows SDK的 EM_SETRECT

示例

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

请参见

参考

CRichEditCtrl选件类

层次结构图

CRichEditCtrl::GetRect