Question how to join to textboxes in listbox

fortune

New member
Joined
Jan 22, 2013
Messages
2
Programming Experience
Beginner
im trying to combine lists from two richtextboxes through a string builder then add it ti listbox
the problem is that with the final step , when i add result to listbox it add list to same line
any help to add each modified line from the two textboxes into a separate item in listbox

here is the code
VB.NET:
Dim sb As New System.Text.StringBuilder
        Dim s As Integer = RichTextBox2.Lines.Length
        Dim c As Integer = RichTextBox3.Lines.Length
        For i As Integer = 0 To RichTextBox2.Lines.Length - 1
            If s <> c Then
                MsgBox("No. of lines in two lists are not Equal")
                Exit For
            Else
                
                sb.AppendLine(RichTextBox2.Lines(i) & ":" & RichTextBox3.Lines(i) & Environment.NewLine)

                

            End If


        Next
        ListBox1.Items.Add(sb)
 

Latest posts

Back
Top