Reputation: 3563
In WinForms how can I change value of the selected item in the listBox? My code doesn't works:
private void button11_Click(object sender, EventArgs e)
{
listBox1.Text = "new value";
listBox1.ValueMember = "new value";
listBox1.SelectedValue = "new value";
listBox1.SelectedItem = "new value";
listBox1.Name = "new value";
}
Edit1:
Upvotes: 0
Views: 6313
Reputation: 3618
try this:
listBox1.Items.Insert(listBox1.SelectedIndex, "new Value");
listBox1.Items.Remove(listBox1.SelectedItem);
Upvotes: 2