It is tempting to override this property in a base form similar to the following:
[C#]
using System;
using System.Drawing;
using System.Windows.Forms;
namespace Samples
{
public class FormBase : Form
{
public override Font Font
{
get { return SystemFonts.MessageBoxFont; }
}
}
}
Unfortunately, due to a known bug [1], text boxes and other system-drawn controls (as opposed to Windows Forms-drawn controls) placed on the form to not draw themselves using the Font. This is despite the controls sizing themselves based on the Font size.
To work around this, explictly set the font in the constructor of the form:
[C#]
using System;
using System.Drawing;
using System.Windows.Forms;
namespace Samples
{
public class FormBase : Form
{
public FormBase()
{
this.Font = SystemFonts.MessageBoxFont;
}
}
}
[1] https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=115480