Files
mRemoteNG/mRemoteV1/UI/FontOverrider.cs
2017-05-10 11:43:03 -06:00

22 lines
755 B
C#

using System.Drawing;
using System.Windows.Forms;
namespace mRemoteNG.UI
{
public class FontOverrider
{
public static void FontOverride(Control ctlParent)
{
// Override the font of all controls in a container with the default font based on the OS version
foreach (Control tempLoopVarCtlChild in ctlParent.Controls)
{
var ctlChild = tempLoopVarCtlChild;
ctlChild.Font = new Font(SystemFonts.MessageBoxFont.Name, ctlChild.Font.Size, ctlChild.Font.Style, ctlChild.Font.Unit, ctlChild.Font.GdiCharSet);
if (ctlChild.Controls.Count > 0)
{
FontOverride(ctlChild);
}
}
}
}
}