private void DeleteItem(MyListItem item) { int index = this.GetItemIndex(item); this.Controls.Remove(item); this.Controls[index - 1].Focus(); this.SubKeyNames.RemoveAt(index - 1); this.SaveSorting(); item.Dispose(); }
private static void RemoveItem(CommonMultiItemsList list, MyListItem item) { int index = list.GetItemIndex(item); list.Controls.Remove(item); list.Controls[index - 1].Focus(); list.SubKeyNames.RemoveAt(index - 1); list.WriteRegistry(); item.Dispose(); }