I have a Richtextbox.Text in my project and I need to save all text lines into a ListBox.Text .
Can you help me please?
Printable View
I have a Richtextbox.Text in my project and I need to save all text lines into a ListBox.Text .
Can you help me please?
The Text of both controls is not relevant. The RTB has a Lines property, which returns a String array. The ListBox has a DataSource property and an Items.AddRange method, both of which will accept a String array.
My problem is that my app make search on google en extract the urls into the richtextbox but I want navigate to this sites and I need save these URLs into a listbox. I need to transfer the urls from the richtextbox to the listbox.
And I told you how it could be done. Now you just have to do it.
Thank you very much
Sorry but I have problem with that I only getting the first lines (items).
Can you help me?Code:Private Sub addlist_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles addlist.Click
Dim NewArray() As String = RichTextBox1.Text.Split(vbNewLine)
For Each item As String In NewArray
ListBox1.Items.Add(item)
Next
RichTextBox1.Text = ""
End Sub
I already did help, but you apparently ignored it. There's not much point my posting the same thing again.