Ged Mead

Ged Mead (XTab) has been around computers since the 1980's when the first affordable home computers came on the market. His journey from that very first Dragon 32 to the present has taken him through many different facets of the IT Industry. These include formal training as a Systems Analyst, employment in a mainframe software development environment, and a short time spent demonstrating rugged military IT systems in the days when it took two strong men to carry a 'mobile' system.
His most rewarding challenge was the creation of a financial management system for a large organisation.
Now based in an idyllic lochside location in the West of Scotland, he is currently involved in a range of development projects, whenever he can drag his gaze away from the stunning surrounding views, that is!
Ged is a Microsoft MVP, Senior Editor for DevCity.NET, vbCity Developer Community Leader and Admin, Helper of the Month competition winner and DevCity.NET newsletter Editor.
View all articles by Ged Mead...
Introduction
Application and User Settings have been given a facelift in VB2005. One of the questions that has appeared in VBCity Forums many times over the past few years is the one where someone wants to know how to save user choices, UI settings or other small items of data that have been input by users. Traditionally, going back to Classic VB days this has been done by using the SaveSettings and GetSettings functions which access the Registry to write and read back the data.
This approach still works and can be used in all versions of VB.NET, including 2005. While it's not difficult to use, I've never thought of it as particularly intuitive either. So it's good to see that in Visual Studio 2005 there is a very easy to use visual feature available from the Project Properties tab. You are then able to navigate through the available settings in code with ease, thanks to the My.Settings feature.
The examples shown in this article are designed for Beginner Level developers as an introduction to the topic. Fire up a new VB 2005 Windows Forms Project and we'll put My.Settings through its paces.
Accessing the Settings Editor at Design Time
You can use the Settings Editor at design time to set up the names and Types of data for which you want to be able to store settings. To access this editor, use your favourite technique to get to the project's Properties window, e.g. by right clicking the project name and selecting "Properties":

or from the main menu:

The initial view of the Settings Tab in the Project's property Pages will look like this:

Creating new Settings is a very easy process as we will see.