c# - Add the same string from textbox in two lines listbox? -


is possible add same string typed in texbox in 2 lines of listbox, shown in image below?

enter image description here

private void metrobutton10_click(object sender, eventargs e)     {         listbox2.items.add("next station: " + metrotextbox1.text);         listbox2.items.add(environment.newline)         metrotextbox1.clear();         listbox2.selectedindex = 0;     } 

use following code.

 private void button1_click(object sender, eventargs e)     {         listbox1.items.add("next station: "+textbox1.text);         listbox1.items.add("station: " + textbox1.text);     } 

you can't use new line. because listbox can contain 1 item in line.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -