...

View Full Version : RichTextBox.text to Listview



kor81
08-09-2012, 08:18 PM
Each line of text in RichTextBox1 needs to be added to Listview2. How can i achieve this?

My Code that adds all text in one line


Dim str() As String = kiword.RichTextBox1.Text.Split(CChar(vbNewLine))
Dim i As Integer = 0
Do
kiword.ListView2.Items.Add(str(i))
i += 1
Loop Until i = str.Count

kor81
08-10-2012, 07:24 PM
Each line of text in RichTextBox1 needs to be added to Listview2. How can i achieve this?

My Code that adds all text in one line

Still haven't figured this out

alykins
08-10-2012, 09:35 PM
form consists of three objects: a button, a listview, and a richtextbox



Public Class Form1

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim demo As String() = RichTextBox1.Text.Split(CChar(vbNewLine))

For Each s As String In demo
Dim lItem As New ListViewItem(s)
ListView1.Items.Add(lItem)
Next


End Sub
End Class



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum