How do you save font information to a file and read it back in for user customization of a label?
Here is where I am at:
From TextFiles example:
Private Sub SaveSettings
File.WriteString(DataFolder, "text.txt", TextArea1.Text)
File.WriteMap(DataFolder, "settings.txt", _
CreateMap("CheckBox1": CheckBox1.Checked, _
"CheckBox2": CheckBox2.Checked, _
"Saved_Font": f))
End Sub
Private Sub LoadSettings
If File.Exists(DataFolder, "settings.txt") Then
Dim settings As Map = File.ReadMap(DataFolder, "settings.txt")
CheckBox1.Checked = settings.GetDefault("CheckBox1", False)
CheckBox2.Checked = settings.GetDefault("CheckBox2", False)
lblWelcome.font = settings.GetDefault("Saved_Font", "")
End If
The problem is that this will error out during compile.
What is the correct way to do this?
Thanks for your help.
Here is where I am at:
From TextFiles example:
Private Sub SaveSettings
File.WriteString(DataFolder, "text.txt", TextArea1.Text)
File.WriteMap(DataFolder, "settings.txt", _
CreateMap("CheckBox1": CheckBox1.Checked, _
"CheckBox2": CheckBox2.Checked, _
"Saved_Font": f))
End Sub
Private Sub LoadSettings
If File.Exists(DataFolder, "settings.txt") Then
Dim settings As Map = File.ReadMap(DataFolder, "settings.txt")
CheckBox1.Checked = settings.GetDefault("CheckBox1", False)
CheckBox2.Checked = settings.GetDefault("CheckBox2", False)
lblWelcome.font = settings.GetDefault("Saved_Font", "")
End If
The problem is that this will error out during compile.
What is the correct way to do this?
Thanks for your help.