If you immediately dispose a resource, you won't be able to use it for the rest of the lifetime of the form.
The Font
is being instantiated when the Form
is instantiated. When you close the Form
, the Font
instance (and anything else created in the InitializeComponent()
method) will go out of scope and be disposed of too.
Leave everything in the Designer.cs
file as-is. There's even the following comment above the InitializeComponent()
method:
Do not modify the contents of this method with the code editor.
Any custom edits you make to it are likely to be overwritten anyway, when you start making other changes to the form at design-time. It's normally not a file you need or want to touch.