/// <summary>
/// 设置控件的双缓存
/// </summary>
/// <param name="c">所需设置双缓存的控件或窗体</param>
public static void SetDoubleBuffered(this Control c)
{
//Taxes: Remote Desktop Connection and painting
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);
}
C# 利用反射机制开启控件双缓存
最新推荐文章于 2023-10-12 22:16:58 发布