08-05-2011, 09:14 PM
Well, you need to combine the two bits of code.. So just insert this whole block into your form:
And make sure that the textbox on the left is called textbox1
Code:
Sub rtb_changed handles RichTextBox1.TextChanged
reLine(RichTextbox1)
End sub
Sub reLine(ByVal rtb as richtextbox)
'Where textbox1 is the textbox on the side of the TextBox1.Text = ""
Dim i As Integer = 1
Do Until TextBox1.Lines.Count = rtb.Lines.Count
TextBox1.AppendText(i.ToString + vbNewLine)
i = i + 1
Loop
End sub
And make sure that the textbox on the left is called textbox1