CEdit::GetLimitText
Call this member function to get the text limit for this CEdit object.
UINT GetLimitText( ) const;
Return Value
The current text limit, in bytes, for this CEdit object.
Remarks
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.
Example
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)
m_myEdit.SetLimitText(nLength);
m_myEdit.SetWindowText(strText);
Requirements
Header: afxwin.h