CEdit::GetLimitText

调用该成员函数获取此 CEdit 对象的文本限制。

UINT GetLimitText( ) const;

返回值

当前文本限制,在字节,此 CEdit 对象的。

备注

文本限制是最大红色文本,如字节,编辑控件可以接受。

备注

此成员函数从Windows 95及Windows NT 4.0开始可用。

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

示例

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);

要求

Header: afxwin.h

请参见

参考

CEdit Class

层次结构图

CEdit::SetLimitText

CEdit::LimitText