I’m trying to remove selected item from ComboBox Collection:
Items are added manually, as a Collection, in design time.
buttonClick:
cb01.Items.Remove(cb01.SelectedItem);.
This deletes the item, but next time I open the Form – the item appears again.
Must I have a database for 5-6 items ?
Please help.
This
cb01.Items.Remove(cb01.SelectedItem);will only remove from the combobox, not from the datasource binded to the combobox. You may remove it from the datasource and re bind the source.If you are binding the combobox with an array in your code, then you may save the array on a persistent storage, either a database table, or XML file and upon deletion from combobox you should remove the element from the array and save the changes to the persistent storage