I've filled a listbox with data, using:
this.listBox1.Items.Add("ONE");
etc.
With some user-input I want to update the text for the selected item.
this.listBox1.Items[listBox1.SelectedIndex] = this.textBox1.Text;
works OK, but it raises the event listBox1_SelectedIndexChange twice. I use that event to populate controls if the user (or my code) actually selects another item, so I'm not to happy about that.
Is there a way around this?
this.listBox1.Items.Add("ONE");
etc.
With some user-input I want to update the text for the selected item.
this.listBox1.Items[listBox1.SelectedIndex] = this.textBox1.Text;
works OK, but it raises the event listBox1_SelectedIndexChange twice. I use that event to populate controls if the user (or my code) actually selects another item, so I'm not to happy about that.
Is there a way around this?