G
Guest
Hi! I implemeted Forms colection described in this link:
http://support.microsoft.com/default.aspx?scid=kb;en-us;815707
I need to loop through the collectionbase and based on form's tag either close the form or do something else.
foreach(Form myForm in Forms)
{
if(myForm.Tag != AppConfig.homePageTitle)
{
myForm.Close();
myForm.Dispose();
}
else
{
// Do something
}
}
I am getting the following error:
"Collection was modified; enumeration operation may not execute."
In good old VB I used a reversed loop. What can I do in C# CollectionBase ?
Many Thanks for your help,
-- Mike
http://support.microsoft.com/default.aspx?scid=kb;en-us;815707
I need to loop through the collectionbase and based on form's tag either close the form or do something else.
foreach(Form myForm in Forms)
{
if(myForm.Tag != AppConfig.homePageTitle)
{
myForm.Close();
myForm.Dispose();
}
else
{
// Do something
}
}
I am getting the following error:
"Collection was modified; enumeration operation may not execute."
In good old VB I used a reversed loop. What can I do in C# CollectionBase ?
Many Thanks for your help,
-- Mike