c# - Count of Text in RichtextBox (Line and Column?) -
im working on code-editor , want know how codes in counting lines , columns in richtextbox . particularly 1 in actual code-editor .
lets count transfer in listbox
is there fast way can it? need , lot in advance! godbless!
this it, have call code inside timer:
int line = 1 + richtextbox1.getlinefromcharindex(richtextbox1.getfirstcharindexofcurrentline()); int column = 1 + richtextbox1.selectionstart - richtextbox1.getfirstcharindexofcurrentline(); label1.text = "line: " + line.tostring() + ", column: " + column.tostring();