Partager via


CRichEditCtrl::GetLimitText

Gets the text limit for this CRichEditCtrl object.

long GetLimitText( ) const;

Return Value

The current text limit, in bytes, for this CRichEditCtrl object.

Remarks

The text limit is the maximum amount of text, in bytes, the rich edit control can accept.

For more information, see EM_GETLIMITTEXT in the Windows SDK.

Example

// The new text of the rich edit control.
LPCTSTR lpszmyString = _T("Here's some text in our rich edit control!");
long nLength = (long)_tcslen(lpszmyString);

// Want the text limit to be at least the size of the new string.
if (m_myRichEditCtrl.GetLimitText() < nLength)
   m_myRichEditCtrl.LimitText(nLength);

m_myRichEditCtrl.SetWindowText(lpszmyString);   

Requirements

Header: afxcmn.h

See Also

Concepts

CRichEditCtrl Class

CRichEditCtrl Members

Hierarchy Chart

CRichEditCtrl::LimitText