自己之前做小工具的时候,遇到这个问题,记录一下。。。

namespace 相册处理

{

    //将ListView重载为此新类,解决加载过程中闪烁的问题

    //在designer.cs中改写:

    //private ListViewNeverFlickering listView1;

    //this.listView1 = new ListViewNeverFlickering();

    internal class ListViewNeverFlickering : System.Windows.Forms.ListView

    {

        public ListViewNeverFlickering()

        {

            // Activate double buffering

            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 override void OnNotifyMessage(Message m)

        {

            //Filter out the WM_ERASEBKGND message

            if (m.Msg != 0x14)

            {

                base.OnNotifyMessage(m);

            }

        }

    }

}

最新文章

  1. 13.代理模式(Proxy Pattern)
  2. Python 简单爬虫
  3. 《零成本实现Web自动化测试--基于Selenium》 第五章 Selenium-RC
  4. java新手笔记12 单例
  5. cookie 和 HttpSession
  6. nova-network创建初始化网络
  7. MFC 在对话框显示图片的多种方法(四种方法)
  8. fopen中的mode(20161115)
  9. Django_404_403_500页面处理
  10. PAT 1152 Google Recruitment
  11. 设置LISTControl控件某一行的背景和文字颜色
  12. 19、AJAX
  13. C++学习(三十六)(C语言部分)之 链表2
  14. python基本数据类型之字符串(二)
  15. java也可以做黑客?
  16. Delphi 10.3.1 TNetHttpClient在多线程中存在的问题及解决方法。
  17. dubbo Framework pic
  18. jni使用javap查看java类方法签名
  19. vs2015新建web应用程序空模板和添加webapi的模板生成文件的比较
  20. LeetCode:寻找数组的中心索引【668】

热门文章

  1. 浅析TCP协议---转载
  2. kafka事务
  3. 两种图片下拉放大效果实现(自定义CoordinatorLayout以及自定义Recylerview)
  4. 异常记录-Gradle依赖掉坑之旅
  5. shell中if/seq/for/while/until
  6. CSS属性(背景属性)
  7. DDD(领域驱动设计)--战略设计
  8. BurpSuite 抓安卓app包
  9. 如何灵活运用ABBYY FineReader的识别功能
  10. 借助Mac自带的强大的搜索功能,如何快速搜索打开Tuxera Disk Manager