0

(Visual studio 2015)How do i make it so when the user runs the program it will save the list box and when the user reopens the program it will automaticlly restore? I have no code on this because im clueless on what to do for it.

  • 1
    Save to file. Load from file. – Alexander Petrov Oct 02 '16 at 08:48
  • But how? I got no idea what to do for that. Ive never saved files like that i only downloaded them from websites – LogandadLoga Oct 02 '16 at 08:52
  • You must determine what are the essential data of the list box. Then you can serialize/de-serialize to XML by creating a class which "represent" your xml structure... – Jean-Claude Colette Oct 02 '16 at 09:05
  • How about [Google?](https://www.google.com/search?q=c%23+persist+data&ie=utf-8&oe=utf-8) - Here are the first hits: [A MSDN tutorial](https://msdn.microsoft.com/en-us/library/mt656718.aspx), [a SO post about using Settings](http://stackoverflow.com/questions/10323755/c-sharp-net-method-to-store-some-very-small-scale-persistent-information), [a discussion of various ways](http://stackoverflow.com/questions/1941928/best-way-to-store-data-locally-in-net-c) and [more ideas](http://stackoverflow.com/questions/1447664/winforms-which-is-easiest-approach-for-persisting-some-data). – TaW Oct 02 '16 at 09:51
  • - Obviously you use the FormLoad and Form.Close events. – TaW Oct 02 '16 at 09:52

0 Answers0