Hai all,
I am using a RichTextbox to read its content line by line.Here is the code I used for that:
Private Sub txt_TextChanged(ByVal sender As System.Object, ByVal e As System.Windows.Controls.TextChangedEventArgs) Handles txt.TextChanged Dim line As [String] Dim trimmedline As String Dim rtbContents As String = New TextRange(txt.Document.ContentStart, txt.Document.ContentEnd).Text For Each line In rtbContents.Split(ControlChars.Lf) trimmedline = line.Trim(" c", ControlChars.Cr) If trimmedLine.Length > 0 Then lb.Content = trimmedLine.First End If Next End SubIt works fine when I write the text directly in the textbox but if I paste a few lines in it,the label only shows the last line.I don't know how to fix it.Can anyone please help me solve this problem?