Files
UVtools/UVtools.GUI/Extensions/ControlExtensions.cs
T
Tiago Conceição 1722951fbf DoubleBuffers
2020-09-11 02:09:43 +01:00

14 lines
544 B
C#

namespace UVtools.GUI.Extensions
{
public static class ControlExtensions
{
public static void SetDoubleBuffered(this System.Windows.Forms.Control c)
{
if (System.Windows.Forms.SystemInformation.TerminalServerSession)
return;
System.Reflection.PropertyInfo aProp = typeof(System.Windows.Forms.Control).GetProperty("DoubleBuffered", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
aProp.SetValue(c, true, null);
}
}
}