Windows 10 64-bit, VB.NET 2017
I have a textbox and I want to persist its value. I type in 20, and usually it persists next time I start program. But sometimes it's blank. Nothing in code changes it. I am debugging another part of code. Sometimes I single-step and edit code. Sometimes I do shift-F5 to end the program. Usually the 20 persists.
In project > props > Settings it is a user variable, string, named: TextBox_OD_log10_gain (same name as the textbox that it sets)
HERE IS WHERE TEXTBOX IS LOADED AT BOOT-TIME.............
Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
application.DoEvents
TextBox_OD_log10_gain.text = my.settings.TextBox_OD_log10_gain
End Sub
HERE IS ONLY PLACE THAT TEXTBOX IS SET...............
Private Sub MainForm_FormClosed(sender As Object, e As FormClosedEventArgs) Handles MyBase.FormClosed
my.settings.TextBox_OD_log10_gain = TextBox_OD_log10_gain.text
My.Settings.Save()
End Sub
' Alessandro Mandelli' below suggests that problem is a malfunction with .NET Framework. Is this true?? Should I just give up on my.settings. and use a different method?