Click here to Skip to main content
16,017,852 members
Please Sign up or sign in to vote.
2.00/5 (2 votes)
See more:
hi how to display string values in listbox from 2 different textbox values.
Posted
Updated 22-Nov-10 5:51am
v2

listBox1.Items.Add(textBox1.Text & " " & textBox2.Txt)


Cheers

Manfred
 
Share this answer
 
you can use Concat Method to Concat two value as given below

ListBox1.Items.Add(String.Concat(TextBox1.Text, TextBox2.Text))

String.concat function is used to creates the string representaion of Specified object
 
Share this answer
 
v2
Comments
rmallamace 22-Nov-10 20:08pm    
You left out the space :-

ListBox1.Items.Add(String.Concat(TextBox1.Text, " ", TextBox2.Text))
For Concatenate strings use this[^]

You can use String.Concat as Ravi said because it's just 2 strings, for massive concatenation I recommend StringBuilder
 
Share this answer
 
 
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