Click here to Skip to main content
15,908,175 members
Please Sign up or sign in to vote.
1.15/5 (3 votes)
See more:
How i cam convert Listbox1 And Listbox2 items to Textbox. ON Button Press..

Convert Format:>

{Listbox1.item1/listbox2.item1} , {listbox1.item2/listbox2.item2} , {listbox1.item3/listbox2.item3} and So On...

i tried Many Codes But Dont WORK...`

VB
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    TextBox1.Lines = ListBox1.Items.Cast(Of String).ToArray & ListBox2.Items.Cast(Of String).ToArray
End Sub`
Posted
Updated 4-May-14 10:27am
v4
Comments
[no name] 4-May-14 12:37pm    
"But Dont WORK" tells us nothing at all about your problem. We cannot see your input, your output, your code or your screen to be able to guess what it is that you think "Don't WORK" means.

1 solution

There are many ways of doing this. My favorite is to loop through the list box and taking each items text and adding that to the text box. I hope this helps?

VB
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        For Each item As String In ListBox1.Items
            TextBox1.Text += item.ToString & vbCrLf
        Next

        For Each item2 As String In ListBox2.Items
            TextBox1.Text += item2.ToString & vbCrLf
        Next
End Sub
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900