How can I delete a specific line of text in a RichTextBox ?
Try this:
Dim lst As New ListBox
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Controls.Add(lst)
For Each cosa As String In Me.RichTextBox1.Lines
lst.Items.Add(cosa)
Next
lst.Items.RemoveAt(2) 'the integer value must be the line that you want to remove -1
Me.RichTextBox1.Text = String.Empty
For i As Integer = 0 To lst.Items.Count - 1
If Me.RichTextBox1.Text = String.Empty Then
Me.RichTextBox1.Text = lst.Items.Item(i)
Else
MeMe.RichTextBox1.Text = Me.RichTextBox1.Text & Environment.NewLine & lst.Items.Item(i).ToString
End If
Next
End Sub
http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/63647481-743d-4e55-9043-e0db5106a03a/