首页 > Windows开发 > 详细

DataGridView减少闪烁的解决办法

时间:2014-08-16 19:41:40      阅读:393      评论:0      收藏:0      [点我收藏+]
Reducing flicker, blinking in DataGridView

http://www.codeproject.com/Tips/390496/Reducing-flicker-blinking-in-DataGridView

 

One of my project requirement was to create a Output Window similar to Visual Studio. For that I used aDataGridView. But when I start my application, I found that there is lot of blinking, flicker, pulling... After badly hitting my head with Google, I found a very easy way. We just need to create a extension method to DataGridView and it‘s all done:

public static void DoubleBuffered(this DataGridView dgv, bool setting) 
{ 
    Type dgvType = dgv.GetType(); 
    PropertyInfo pi = dgvType.GetProperty("DoubleBuffered", 
          BindingFlags.Instance | BindingFlags.NonPublic); 
    pi.SetValue(dgv, setting, null); 
}

DataGridView减少闪烁的解决办法,布布扣,bubuko.com

DataGridView减少闪烁的解决办法

原文:http://www.cnblogs.com/zfanlong1314/p/3916770.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!