If your using VB express 2005 then this is extremely simple to save settings to the application.configuration file and not to the registry
If you want to do setting is VB Express/2005 then simply add the settings in My Project -> set the type in my case system.drawing.color
and use
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click '//Change and Save Setting My.Settings.Forecolor = Color.Black My.Settings.Save()
'//I have a setting called forecolor and its set Me.Label1.BackColor = My.Settings.Forecolor
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click '//Change and Save Setting My.Settings.Forecolor = Color.Aquamarine My.Settings.Save()
'//I have a setting called forecolor and its set Me.Label1.BackColor = My.Settings.Forecolor End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Label1.ForeColor = My.Settings.Forecolor '//Load Setting End Sub End Class
Its extremely simple and the setting is strongly typed to system.drawing.color.
|