listBox1.Items.Remove help
From: Bilo (justler123_at_yahoo.com)
Date: 04/22/04
- Next message: Grant: "Beginner"
- Previous message: jmajor: "RE: Session timeout"
- Next in thread: Julie: "Re: listBox1.Items.Remove help"
- Reply: Julie: "Re: listBox1.Items.Remove help"
- Reply: Bjorn Abelli: "Re: listBox1.Items.Remove help"
- Reply: someone: "Re: listBox1.Items.Remove help"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 23 Apr 2004 01:34:23 +0200
I dont know what i am doing false.
the code :
private void button2_Click(object sender, System.EventArgs e)
{
foreach (string filename in listBox1.SelectedItems)
listBox1.Items.Remove(filename);
}
gives me the error :
System.InvalidOperationException: The list that this enumerator is bound to
has been modified. An enumerator can only be used if the list doesn't
change.
at
System.Windows.Forms.EntryEnumerator.System.Collections.IEnumerator.MoveNext
()
Anyone can help?
- Next message: Grant: "Beginner"
- Previous message: jmajor: "RE: Session timeout"
- Next in thread: Julie: "Re: listBox1.Items.Remove help"
- Reply: Julie: "Re: listBox1.Items.Remove help"
- Reply: Bjorn Abelli: "Re: listBox1.Items.Remove help"
- Reply: someone: "Re: listBox1.Items.Remove help"
- Messages sorted by: [ date ] [ thread ]