I use a textbox with AutoCompleteCustomSource. I want to save all the entries within the textbox and autocomplete them when the user enters a matching value.
When the application is closed then re-opened these values are lost.
By now I have a code like this
puclic AutoCompleteStringCollection emails ;
//OnFormCreate
...
emails = new AutoCompleteStringCollection();
...
//OnUserInteraction
...
emails.Add(EMail);
...
How can I save and reload the list?
This is a convenient feature, not a critical one, so I need an easy code: “less is more”.
You can easily save it as XML:
To load the list from XML:
You could probably save it in the project’s user settings too