M
M
Max Zhukov2018-02-01 17:54:33
C++ / C#
Max Zhukov, 2018-02-01 17:54:33

How to get row and column number in richtextbox?

How to get row and column number in richtextbox?
int i = richTextBox1.SelectionStart;
int line = richTextBox1.GetLineFromCharIndex(i);
label1.Text = line.ToString();
int fc = richTextBox1.GetFirstCharIndexFromLine(line);
int column = i - fc;
label2.Text = column.ToString();
it's not right here

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question