I have a strategy where i have a button, which includes the following code.
It is supposed to remove certain DrawObjects.
foreach(IDrawObject draw in DrawObjects)
{
if(draw.Tag.StartsWith("Name"))
{
Print(draw.Tag);
// RemoveDrawObject(draw.Tag);
}
ChartControl.ChartPanel.Refresh();
}
if I run the code like that without the RemoveDrawObject statement, it prints all the desired DrawObjects to the Output Window.
If I uncomment the RemoveDrawObject statement,
it prints only one tag and removes only one Object.
Why does the code not remove all objects which were printed to the Output window, when the statement was commented out?

Comment