1
The numbering you say has a logical sequence?
I suggest, put an event in the keypress of your richtextbox1
I transferred the text of rchtb1 to an array (Split breaking the lines at each Enter) for each line I wrote on 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 understand very well, you should put before the variable linha
in the richTextBox2.AppendText
.
Hello, André. Welcome to Stack Overflow. The question is not clear enough and therefore it is not possible to give a good enough answer. When you have enough reputation, you can comment on publications to ask for clarification.
– Pablo Almeida
the sequence is not logical, it is only finite, has a certain number of "enters", ie, has a limit of lines that can type. thanks for the help @André Alves
– Petrukio