This is a short and very basic tutorial about creating, using and saving My.Settings default values in Visual Basic 2005. By completing this tutorial you will learn the basic steps involved in creating Settings that can be saved and re-loaded the next time your application is run.
Open Visual Studio 2005, create a new project and name it: VbCity Sample Project
Press the "Project" menu item, then press the "VbCity Sample Project Properties..." sub-menu. The VbCity Sample Project Properties Window will open. Press the "Settings" Tab located near the center left of the window.
The Settings Window is where you add variables/constants that can be used anywhere throughout the entire project. If you take a peek at the options listed in the 'Scope' ComboBox, you will see a choice of 'User' or 'Application'. Application Scope is used as a constant, which means the value you add in design-view cannot be changed during runtime.
A good example of Application Scope is a database connection string. Normally, a connection string is set by the programmer and isn't changed by the user.
User Scope is used as a variable, which means you can change its value during runtime. Another great advantage of a User Scope variable is that you can save the value to reuse next time the application is run. All of the examples in this tutorial will use the User Scope.