Hi,
I looked at the library. Could you please provide an example?
Say that I want to save a simple textbox like My.Settings.text = TextBox1.Text
and then load it like: TextBox1.Text = My.Settings.text
Whats the best way i can do that?
Thanks. I'm still trying to figure out how I could save booleans like checkboxes, I can't seem to find the proper code for saving, and loading them.
Could you provide some help please ?
I never worked with checkboxes but I guess it will be something like
B4X:
'load or set first time defaults
StateManager.loadStateFile
chkOption1.checked=StateManager.GetSetting2("option1",0)
'saving
StateManager.SetSetting("option1",chkOption1.checked)
StateManager.SaveSettings
I never worked with checkboxes but I guess it will be something like
B4X:
'load or set first time defaults
StateManager.loadStateFile
chkOption1.checked=StateManager.GetSetting2("option1",0)
'saving
StateManager.SetSetting("option1",chkOption1.checked)
StateManager.SaveSettings
'load or set first time defaults
StateManager.loadStateFile
if StateManager.GetSetting2("option1",0)=0 then
chkOption1.checked=false
else
chkOption1.checked=true
end if
'saving
if chkOption1.checked=false then
StateManager.SetSetting("option1",0)
else
StateManager.SetSetting("option1",1)
end if
StateManager.SaveSettings
Thank you! That one worked. And do you also know how I can do the same with text and labels? Since I'm not sure if StateManager.SetSetting("text1",1) would work with Strings.