Question My.settings save only font name, not size

ud2008

Well-known member
Joined
Jul 5, 2010
Messages
148
Programming Experience
Beginner
I have a question how can I save in My.Settings only the font name and not the size.

Let me explain a little.

I have a form where I can change the font for a label on another form. This works perfect.
I can even save it in my.settings.

The thing is though, that on that other form I have 2 labels, thet should have the same font name, but the size should be different. (label1 has font size = 40 (can be changed) and label2 should have a fixed font size (should not be changed)).

I tried to use label2.font.size = "14", but font.size is readonly.

How can I do this?

Thanks
 
The size of Font is only set with a constructor: Font Constructor (System.Drawing)
You can save a full Font object (with family name, size, and styles) in setting, and modify that to a new size, or just store the FontFamily string name.
 
Back
Top