Элемент управления ScintillaNet имеет это свойство :
public LineCollection Lines { get; }
Вы можете выполнить итерацию этой коллекции и добавить номера строк следующим образом:
using System.Windows.Forms;
using ScintillaNET;
string _s=""; //The string where you will get the results
foreach (Line _l in scintilla1.Lines) //scintilla1 is the name of your ScintillaNet control
//Line is a class that represents an individual line of text and has several properties
{
_s += "Line " + (_l.Index + 1).ToString() + ": " + _l.Text;
}
MessageBox.Show(_s);
Если выустановите элемент управления с этим текстом:
Bla, bla, bla 1
Bla, bla, bla 2
Bla, bla, bla 3
Bla, bla, bla 4
Вы получите этот результат:
![enter image description here](https://i.stack.imgur.com/E5r6w.png)