简体   繁体   中英

Saving contents of a listBox to program settings C#

So what I am trying to do is save the contents from a listBox to the application Properties.Settings.Default I have no idea where to start, nor do I know if it is even possible. Thanks in advance.

any settings you have setup in Properties-> settings tab should show up like

[your namespace].Properties.Settings.Default.yoursetting = "change";

after you edit your properties always call

[your namespace].Properties.Settings.Default.Save();

the save part got me at first.

for list types use :

清单设定

it will help if your objects can be converted to and from strings anything more not really sure for anything more complex but I hope this gets you started.

foreach(string s in listbox.Items){[settingscode].add(s);}

something like that anyways.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM