public void Remove(ucDynamicStepItem item) { if (item != null) { item.EventMouseDoubleClick -= new ucDynamicStepItem.delegateEventMouseDoubleClick(si_EventMouseDoubleClick); this.Controls.Remove(item); items.Remove(item); item.Dispose(); } }
public void RemoveAt(int index) { if (index >= 0 && index < items.Count) { ucDynamicStepItem si = items[index]; si.EventMouseDoubleClick -= new ucDynamicStepItem.delegateEventMouseDoubleClick(si_EventMouseDoubleClick); this.Controls.Remove(si); items.RemoveAt(index); si.Dispose(); } }