Listview的闪烁问题
在更新Listview数据时会出现闪烁,主要原因是没有开启双缓冲属性,在C#中可以通过重载Listview的方式开启,代码如下:
using System.Windows.Forms;
public class DoubleBufferListView : ListView
{
public DoubleBufferListView()
{
SetStyle(ControlStyles.DoubleBuffer | ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
UpdateStyles();
}
}
public class DoubleBufferListView : ListView
{
public DoubleBufferListView()
{
SetStyle(ControlStyles.DoubleBuffer | ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
UpdateStyles();
}
}