为什么在winform中datagridview会有闪烁的情况,该如何处理
2016-10-02
展开全部
给你个例子参考:
public class FlickerFreeListView : ListView
{
public FlickerFreeListView()
{
SetStyle(ControlStyles.DoubleBuffer |
ControlStyles.AllPaintingInWmPaint |
ControlStyles.OptimizedDoubleBuffer, true);
UpdateStyles();
}
}
然后在ListView所在窗体的InitializeComponent方法中,更改控件类型实例化语句为:
myListView = new FlickerFreeListView();
public class FlickerFreeListView : ListView
{
public FlickerFreeListView()
{
SetStyle(ControlStyles.DoubleBuffer |
ControlStyles.AllPaintingInWmPaint |
ControlStyles.OptimizedDoubleBuffer, true);
UpdateStyles();
}
}
然后在ListView所在窗体的InitializeComponent方法中,更改控件类型实例化语句为:
myListView = new FlickerFreeListView();
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询