protected override void OnControlRemoved(ControlEventArgs e)
{
// don't do anything if we are animating
// (as we're probably the ones who removed the control)
if (this.Animating)
{
return;
}
base.OnControlRemoved(e);
// remove the control from the itemList
if (this.Items.Contains(e.Control))
{
this.Items.Remove(e.Control);
}
// update the layout of the controls
this.DoLayout();
}