foreach (ListItem li in ListBox.Items) { if (li.Selected == true) { // what ever you want to assign to TextBox Name = li.Text = ""; ProductNumber = li.Text = ""; ListPrice = li.Text = ""; Color = li.Text = ""; MoreInfo = li.Text = ""; Name=li.Text=li.Text+ }
if (ListBox.SelectedItem != null) Name = ListBox.SelectedItem.Text;
private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { textBox1.Text= listBox1.SelectedItem.ToString(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)