Recommended approach for Saving User Settings on forms?

A

Anon

Hi all:

Another question again...

We have a requirement to save user profile information for our application.
The user would like to be able to login to the application and have all of
their "necessary" settings remembered from their previous session. I've
done this before in Java by determining which info to save (ie, which
windows were opened, were they were (x,y) on the desk top, the dimensions of
sizable controls that they adjusted the size to, etc..) and persisting it to
an XML document and then persisting that document. When logging in, I'd
get the document and "reconstruct" what they were doing based on the
document.

This was in Java/Swing. I'm somewhat new to Windows forms and .NET and am
learning more about it but am nowhere near proficient as I was in
Java/Swing. Does the Windows API / .NET 2.0 framework have anything
available that easily saves the state of all opened windows and their
dimensions of each control within each window? I'm going to guess the
answer is no and I'm prepared to do it the same way I did it in the Java
application but I thought I'd ask in hopes that Microsoft provided this
useful feature :)

thanks again for any help... Even if the answer is "no" or "I don't think
so", I am grateful for your time.
 
K

Kevin Spencer

Application Settings can be saved on per-user or per-application bases. The
framework for it is relatively simple to use.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.
 
A

Anon

Hi Kevin:

thanks... What's the name of the framework/API? What can I do a google
search on in order to find a page(s) that describes how to use it?

thanks again...
 
F

Frustrated

"Anon" <[email protected]> kirjoitti viestissä:[email protected]...

thanks... What's the name of the framework/API? What can I do a google
search on in order to find a page(s) that describes how to use it?

Here's little "tutorial" I quickly put together (had it about done, just
haven't had time to finish layout for my site etc. so It's been sitting on
HD)about saving settings.
http://www.sorrowman.org/c-sharp-programmer/save-user-settings.html

Hopefully I didn't manage forget anything crucial :) 7am and still "up" here
so might have forgotten something...

<snip>
 
S

SorrowMan

Anon said:
Wow!!!

thank you for this. It's leading me into the right direction.

thanks!!!

No problem. If you are using Visual basic instead, pretty much all same
apply, except that then in form load you would do

Me.Size = My.Settings.FormSize

And in form closing:

My.Settings.FormSize = Me.Size
My.Settings.Location = Me.Location
My.Settings.Save()

That should get you going :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top