private static void AddItem(this System.Windows.Forms.ComboBox lstControl, string value) #endif { int newIndex = lstControl.Items.Add(value); _dictionaryOfNewIndexes[lstControl.GetHashCode()] = newIndex; }
private static void AddItem(this System.Windows.Forms.ComboBox lstControl, string value, int index) #endif { try { lstControl.Items.Insert(index, value); _dictionaryOfNewIndexes[lstControl.GetHashCode()] = index; } catch { } }
private static void RemoveItem(this System.Windows.Forms.ComboBox lstControl, int index) #endif { try { if (lstControl.Text == lstControl.Items[index].ToString()) { lstControl.Text = string.Empty; } lstControl.Items.RemoveAt(index); _dictionaryOfNewIndexes[lstControl.GetHashCode()] = -1; } catch { } }