CEdit::GetLineCount

调用该函数检索的行数在多行编辑控件的。

int GetLineCount( ) const;

返回值

包含的行数整数在多行编辑控件。 如果文本尚未输入编辑控件,则返回值是1。

备注

GetLineCount 由多行只处理编辑控件。

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

示例

int i, nLineCount = m_myEdit.GetLineCount();
CString strText, strLine;
// Dump every line of text of the edit control. 
for (i=0; i < nLineCount; i++)
{
   // length of line i: 
   int len = m_myEdit.LineLength(m_myEdit.LineIndex(i));
   m_myEdit.GetLine(i, strText.GetBuffer(len), len);
   strText.ReleaseBuffer(len);
   strLine.Format(_T("line %d: '%s'\n"), i, strText);
   AFXDUMP(strLine);
}

要求

Header: afxwin.h

请参见

参考

CEdit Class

层次结构图