Thursday, 15 August 2013

vb.bet richtextbox to listbox

vb.bet richtextbox to listbox

I wish to create a listbox with multiple columns in VB.Net. The items will
be added in runtime, text from a richtextbox. As far as I tried, it works,
but not in multiple column. Eg: 1, 2, 3, hello world.. they are all
invidual selection. How can i group 1,2,3 together in a listbox? Thanks in
advance!
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim r1 As New RichTextBox
r1.Text = "1" & vbNewLine & "2" & vbNewLine & "3"
Dim r2 As New RichTextBox
r2.Text = "hello world"
ListBox2.Items.AddRange(Split(r1.Text, vbLf))
ListBox2.Items.Add(r2.Text)
End Sub

No comments:

Post a Comment