Document: Using My.Settings in VB.NET:
http://msdn.microsoft.com/en-us/library/ms379611(VS.80).aspx
1) For example: Persist Form BackColor property value.
Create a New Setting:
Project menu-> Properties -> Settings ->create a setting as below
Name Type Scope Value
myColor System.Drawing.Color User SkyBlue
Read Settings when Form_Load
Me.BackColor = My.Settings.myColor
Change and save Settings
My.Settings.myColor = Color.AliceBlue
My.Settings.Save()
Related thread:
http://social.msdn.microsoft.com/forums/en-US/Vsexpressvb/thread/5f759564-1b67-40e7-8a3e-828783699b6a/
2) In addition, if you want to persist/store collection data (e.g. ListBox.Items, ComboBox.Items), you need to choose System.Collections.Specialized.StringCollection data type. Here is the walkthrough:
I. Project -> Properties -> Settings -> Create a setting variable:
Name ListBoxCollection
Type System.Collections.Specialized.StringCollection (Browser and locate this type)
Scope User
Value (Add at least one item to initialize it)
II. Code sample
Prerequisites: Drag&drop ListBox1, TextBox1 and Button1 onto Form1.