Assuming you already know how to edit your background color. All you need to do is write 2 functions:
SaveBGColor and RestoreBGColor
These functions will write a .txt file that has the color's rgb value stored in it so you can restore it. The code I am attaching I wrote to restore the background of the Form from what it was last time the program was openned. It stores the ARGB value of the color into a txt file (filename set with a constant) and upon openning it checks for that file and loads from it.
Note: I call SaveBGColor on the MyBase.Closing event and I call the RestoreBGColor on the MyBase.Load event
Const SettingsFile As String = "BackColor.txt"
Sub RestoreBGColor()
'Aquire the full pathname for the application
'This allows us to keep the settings file in the
'same directory as the application
'This may not be needed, but it's a habit from VB 6.0
Dim appPath As String = Application.StartupPath
'This appends a \ on the path if it doesn't have one on it
If appPath.Substring(appPath.Length - 1, 1) <> "\" Then appPath &= "\"
'Check if SettingsFile exists
If IO.File.Exists(appPath & SettingsFile) Then
'Set F to the next available open file number
Dim F As Integer = FreeFile()
'Open the file for Input mode (from a file into program)
FileOpen(F, appPath & SettingsFile, OpenMode.Input)
'Check if the file is empty, if it is, close the connection and exit the sub
If EOF(F) Then
FileClose(F)
Exit Sub
End If
'Create an integer object to load the ARGB value into
Dim I As Integer
'Best to put file manipulation stuff into a try catch and have it
'tell you the error it caught (msgbox ex.message)
Try
'This takes the integer value from the file into variable I
Input(F, I)
Catch ex As Exception
MsgBox(ex.Message)
End Try
'Set the background color to .FromARGB(I)
Me.BackColor.FromArgb(I)
'Close the file connection
FileClose(F)
End If
End Sub
Sub SaveBGColor()
Dim appPath As String = Application.StartupPath
If appPath.Substring(appPath.Length - 1, 1) <> "\" Then appPath &= "\"
Dim F As Integer = FreeFile()
'Open the file for output mode (storing a value into a flat file)
FileOpen(F, appPath & SettingsFile, OpenMode.Output)
'Best to put file manipulation stuff into a try catch and have it
'tell you the error it caught (msgbox ex.message)
Try
'Print, PrintLine, Write, and WriteLine all output to a file
Print(F, Me.BackColor.ToArgb)
Catch ex As Exception
MsgBox(ex.Message)
End Try
'Close the file connection
FileClose(F)
End Sub