In Visual Studio 2005, this is much easier than the suggestions you've been
given so far.
Go to the Design view of the Control you wish to save and restore these
properties for, and go to the Properties View of the Control. Find the
"Data" section, and expand the "ApplicationSettings" node. Find the
"PropertyBinding" box and click it, then click on the button with the
ellipse that appears on the right-hand side of it. You will see a list of
all the available bindable properties for the Control. Select the "Position"
property, and click on the box on the right of it. Open the drop-down list
box, and select "new" from the list. You will get a dialog box with 3 items
in it: Default Value, Name, and Scope. Scope will already be set to User,
which is what you want, since only User-Scoped settings may be saved. The
Default Value will be set to the Default value you've already assigned to
that property. Give the Property Setting a name that is easy to identify,
such as "MyControlPosition". Okay your way back out.
You will see that if you open the Project Properties box (right-click the
Project in the Solution, and select "Properties" from the context menu),
there will be a new User-Scoped Setting added, according to your wishes. All
that is left now is to ensure that it gets saved when it is changed. To do
this, just override the OnClosing method of your Form. Add the following
line to the method:
Properties.Settings.Default.Save();
You can easily do this with any Control in the Form.
--
HTH,
Kevin Spencer
Microsoft MVP
Virtual Carpenter
http://unclechutney.blogspot.com
Never trust a dunderhead with a blunderbuss.