Article Options
Premium Sponsor
Premium Sponsor

 »  Home  »  .NET Newbie  »  Creating, Using and Saving My.Settings Default Values in Visual Basic 2005  »  Saving Setting value changes at runtime
 »  Home  »  Visual Studio 2005  »  Creating, Using and Saving My.Settings Default Values in Visual Basic 2005  »  Saving Setting value changes at runtime
Creating, Using and Saving My.Settings Default Values in Visual Basic 2005
by Dave Barr | Published  05/29/2006 | .NET Newbie Visual Studio 2005 | Rating:
Dave Barr
Not much to tell, so for now view some of my custom logo designs, and a photograph of mine that made it to the local newspaper. 

View all articles by Dave Barr...
Saving Setting value changes at runtime

Add a Form1_FormClosing event. Type this code:

My.Settings.DefaultName = Me.TextBox1.Text

Now press F5 to run. This time, change the text in the textbox from 3-bSoftware.com to your name. Close the form. Close the project. Close Visual Studio. If you like, you can restart your computer too.

Next time you run the "VbCity Sample Project" you will see the name you just typed in the TextBox.

You can use this same process to save any of the 'User Scope' variable changes. Try practising by saving different values for the DefaultColors, or DefaultFont. Good luck!

Thank you for reading my article, Dave.

 

How would you rate the quality of this article?
1 2 3 4 5
Poor Excellent
Tell us why you rated this way (optional):

Article Rating
The average rating is: No-one else has rated this article yet.

Article rating:3.67441860465116 out of 5
 86 people have rated this page
Article Score34790
Sponsored Links