We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.


Call this member function to get the text limit for this CEdit object.

UINT GetLimitText( ) const;

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

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


This member function is available beginning with Windows 95 and Windows NT 4.0.

For more information, see EM_GETLIMITTEXT in the Windows SDK.

CString strText(_T("I'm an edit control!"));
UINT nLength = strText.GetLength() * sizeof(TCHAR);

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


Header: afxwin.h