property Edit.TextLine(Index as Long) as String
Specifies the line based on its index.

TypeDescription
Index as Long A long expression that defines the index of line being accessed. The Index is 1 based.
String A string expression that defines the line's text.

Use the TextLine property to access a particular line in the control's text. Use the Text property to access the control's text when MultiLine property is False. Use the DeleteLine method to delete a particular line. Passing an empty string to the TextLine property doesn't remove the line. It just erases the line's content. The Count property counts the number of lines in the control.

The following VB sample prints the line in the control:

With Edit1
    Dim i As Long
    For i = 1 To .Count
        Debug.Print .TextLine(i)
    Next
End With

The following C++ sample prints the line in the control:

for ( long i = 1; i <= m_edit.GetCount(); i++ )
	OutputDebugString( m_edit.GetTextLine( i ) );

The following VB.NET sample prints the line in the control:

With AxEdit1
    Dim i As Integer
    For i = 1 To .Count
        Debug.WriteLine(.get_TextLine(i))
    Next
End With

The following C# sample prints the line in the control:

for (int i = 1; i <= axEdit1.Count; i++)
	System.Diagnostics.Debug.WriteLine(axEdit1.get_TextLine(i));

The following VFP sample prints the line in the control:

with thisform.Edit1.Object
	local i
	for i = 1 to .Count
		wait window nowait .TextLine(i)
	next
endwith