C#中使用ListView动态添加数据不闪烁
来源:互联网 发布:淘宝卖家怎么改运费 编辑:程序博客网 时间:2024/05/16 13:52
首先,自定义一个类ListViewNF,继承自 System.Windows.Forms.ListView
class ListViewNF : System.Windows.Forms.ListView
{
public ListViewNF()
{
// 开启双缓冲
this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint,true);
// Enable the OnNotifyMessage event so we get a chance to filter out
// Windows messages before they get to the form's WndProc
this.SetStyle(ControlStyles.EnableNotifyMessage,true);
}
protected overridevoid OnNotifyMessage(Message m)
{
//Filter out the WM_ERASEBKGND message
if (m.Msg != 0x14)
{
base.OnNotifyMessage(m);
}
}
}
然后,修改我们的Form代码中定义ListView的位置,将原来的
System.Windows.Forms.ListView listView1;
修改为
ListViewNF listView1;
ok,然后随便怎么insert\add这个listView1,都不会有半点的闪烁了.
- C#中使用ListView动态添加数据不闪烁
- C#中使用ListView动态添加数据不闪烁
- C#中使用ListView动态添加数据不闪烁
- C#使用ListView动态添加数据屏幕闪烁的解决方法之一
- C#不闪烁的ListView
- C#使用ListView更新数据出现闪烁解决办法
- 动态的向ListView中添加数据
- ListView动态添加数据
- 解决C#中ListView闪烁的办法
- Android中使用Listview动态加载数据
- 解决listView动态添加是闪烁的问题
- 解决C#中ListView数据刷新时界面闪烁的问题
- Android -- ListView 动态添加数据
- Listview动态添加/删除数据
- Listview动态添加/删除数据
- C# 向ListView中添加多列数据的方法
- Fragment中添加ListView而不使用ListFragment
- C#解决动态添加控件时,控件闪烁的问题
- Android Studio系列教程五--Gradle命令详解与导入第三方包
- ucontext-人人都可以实现的简单协程库
- Java 类的生命周期
- Oracle EBS 客制键弹性域编译失败
- 测试基础
- C#中使用ListView动态添加数据不闪烁
- Google APAC 2016 University Graduates Test Round C解题报告
- ubuntu 下安装 php mcrypt扩展
- PHP 7 vs HHVM 比较—兄弟连IT教育
- mysql 安装启动
- caffe 练习3 用caffe提供的C++函数批量抽取图像特征------by 香蕉麦乐迪
- jQuery插件开发
- php.exe 加入环境变量
- 自勉