Private Sub rtb_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles rtb.MouseUp
Dim intSelPos As Integer
Dim intSelStart, intSelLength As Integer
intSelPos = rtb.SelectionStart
intSelStart = rtb.Text.LastIndexOf(ControlChars.Lf, intSelPos)
If intSelStart = -1 Then intSelStart = 0
intSelLength = rtb.Text.IndexOf(ControlChars.Lf, intSelStart + 1) - intSelStart
If intSelLength < 0 Then intSelLength = rtb.Text.Length - intSelStart
If intSelStart = 0 Then
intSelStart = -1
intSelLength += 1
End If
rtb.SelectionStart = intSelStart + 1
rtb.SelectionLength = intSelLength - 1
End Sub