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?

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
Post a Comment