I have a Visual Basic 2010 Express project that I'm developing. It includes an option to change the font in some display grids. Here's the code.
Private Sub btnFont_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFont.Click
FontPicker.Font = My.Settings.GridFont
Dim result As DialogResult = FontPicker.ShowDialog
If result = DialogResult.OK Then
Dim newfont As Font = FontPicker.Font
My.Settings.GridFont = newfont
lblFont.Font = My.Settings.GridFont
It works, there's no problem from that point of view. Not only is the change in font reflected while the project is running but it is also retained from one run to the next, including over a full system shutdown.
But what I cannot work out is where that selection is stored. If I look at the settings tab in Project Properties it never changes: it is always set at Microsoft Sans Serif, 8.25pt, even when the font actually being used is, for instance, Comic Sans MS, Bold Oblique, 10pt. I've inspected all the settings and config files I can find in the project directory and all sub-directories, but can find nothing apart from Microsoft Sans Serif, 8.25pt. But the changed value must be being stored somewhere or it wouldn't work.
Where is it?