richtextbox1
the text will appear in richtextbox2
, just like if it was a line counter, every time you enter enter, only with a number itself, type a1, a9, b, c4, c5 ......
see the image here
Does the numbering you say have a logical sequence?
I suggest putting an event in the keypress of your richtextbox1
I transferred the text of rchtb1 to an array (Split breaking lines at each Enter) for each line I wrote in rchtb2 and broke the line.
private void richTextBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
richTextBox2.Clear();
string texto = richTextBox1.Text;
string[] linhas = texto.Split('\n');
foreach (string linha in linhas)
{
richTextBox2.AppendText(linha + Environment.NewLine);
}
}
}
If you want to define this sequence, which I did not quite understand, you should put before the variable linha
in richTextBox2.AppendText
.