CEdit::LineIndex
문자 줄 내의 여러 줄 편집 컨트롤의 인덱스를 검색 하려면이 함수를 호출 합니다.
int LineIndex(
int nLine = -1
) const;
매개 변수
- nLine
편집 컨트롤의 텍스트에는 줄의 인덱스 값 또는-1이 들어.경우 nLine – 1 이며 현재 캐럿이 있는 줄, 즉 줄을 지정 합니다.
반환 값
지정 된 줄의 문자 인덱스 nLine 또는 지정한 줄 번호 편집 컨트롤의 줄 수를 보다 큰 경우-1입니다.
설명
문자 인덱스 문자 편집 컨트롤의 시작 부분에서 지정 된 줄 수입니다.
이 멤버 함수는 여러 줄 편집 컨트롤에 의해 처리 됩니다.
자세한 내용은 EM_LINEINDEX 에 있는 Windows SDK.
예제
// The string for replacing.
CString strString(_T("Hi, we're the replacements."));
int nBegin, nEnd;
// Replace the second line, if it exists, of the edit control
// with the text strString.
if ((nBegin = m_myEdit.LineIndex(1)) != -1)
{
nEnd = nBegin + m_myEdit.LineLength(nBegin);
m_myEdit.SetSel(nBegin, nEnd);
m_myEdit.ReplaceSel(strString);
}
요구 사항
헤더: afxwin.h