VB - Settings
Hello !
In this tutorial I'll teach you how to use settings in visual basic 2010/2008.
1. What are settings?
Settings are a type of information which you can save and load when your program starts.
To use the settings, You'll need to doubleclick this first:
You will then see something like this:
You will need to click the settings tab to get to the settings.
You are now in the settings menu where you can create/edit/delete settings.
For this tutorial we'll make a program that will save and load a setting when clicking a button.
1. Start a new project and call it settings.
2. Go to the setitngs of your application and make a new setting called "btnSetting" , leaving the value empty:
Return to your form and add the following components:
2*Button
1*Textbox
3. Double click the save button and add the following codes:
YourProjectName.My.Settings.btnSettings = TextBox1.Text
(In this case it will be settings.My.Settingc.btnsettings = TextBox1.Text , because I named my project "settings")
4. Double click the Load button and add the following codes:
TextBox1.Text = YourProjectName.My.Settings.btnSettings
Now run your program and you'll be able to load your textbox' text even when restarting your application !
Download the project:
settings.rar (63,9 kB)
Topic: VB - Settings
—————
—————
—————
—————
—————
—————