You can make mySettings global and call at beginning
mySettings.Reload()
like in the MSDN sample at ApplicationSettingsBase Class
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a Windows Form project that requires flexibility for users to navigate to a working directory of their own choice. I created a form settings class that inherits from ApplicationSettingsBase.
Users setup the working directory through a context menu and a folder browser dialog presents the user to navigate to their own working directory.
I save the working directory settings like this:
Private Sub SetupWorkingDirectoryToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SetupWorkingDirectoryToolStripMenuItem.Click
Dim mySettings As New FormSettings()
FolderBrowserDialog1.Description = "Navigate to 'APEX\WinAPEX1501' folder in your Working Directory"
Dim result As DialogResult = FolderBrowserDialog1.ShowDialog()
If (result = DialogResult.OK) Then
Dim APEXPATH As String = FolderBrowserDialog1.SelectedPath
mySettings.WorkingDirectory = APEXPATH
mySettings.Save()
End If
End Sub
How do I persist the settings so that when users exit the application and use it again later, the settings can be "recalled"?
Appreciate any help.
You can make mySettings global and call at beginning
mySettings.Reload()
like in the MSDN sample at ApplicationSettingsBase Class