mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-25 19:38:37 +08:00
22 lines
755 B
C#
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);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |