C#窗口防止闪烁两种方法
2021-02-15 09:17
标签:两种 param div increase set override stat protected color C#窗口防止闪烁两种方法 标签:两种 param div increase set override stat protected color 原文地址:https://www.cnblogs.com/zhaogaojian/p/8437040.htmlpublic class PaintIncrease
{
public static void SetDoubleBuffered(object obj)
{
Type type = obj.GetType();
PropertyInfo pi = type.GetProperty("DoubleBuffered",
BindingFlags.Instance | BindingFlags.NonPublic);
pi.SetValue(obj, true, null);
}
}
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x02000000;
return cp;
}
}