zoukankan      html  css  js  c++  java
  • dataGridView 闪烁 和 listview 闪烁 的解决办法。


    /// <summary>
            ///双缓冲DataGridView,解决闪烁
            /// </summary>
            class DoubleBufferListView : DataGridView
            {
                public DoubleBufferListView()
                {
                    SetStyle(ControlStyles.DoubleBuffer | ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
                    UpdateStyles();

                }
            }

    然后在DataGridView所在窗体的InitializeComponent方法中,更改控件类型实例化语句为:

                //this.dataGridView1 = new System.Windows.Forms.DataGridView();   (屏蔽掉)
                this.dataGridView1 = new DoubleBufferListView();


    **///////////////////////////////////////////////////////////////////////////////////////////////



     /// <summary>
            ///双缓冲ListView ,解决闪烁
            /// </summary>
            class DoubleBufferListView : ListView 
            {
                public DoubleBufferListView()
                {
                    SetStyle(ControlStyles.DoubleBuffer | ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
                    UpdateStyles();

                }
            }

    然后在ListView 所在窗体的InitializeComponent方法中,更改控件类型实例化语句为: 
                        
                //this.listView1 = new System.Windows.Forms.ListView();    (屏蔽掉)
                this.listView1 = new DoubleBufferListView();

  • 相关阅读:
    经典SQL语句大全
    《构建高性能Web站点》观后感
    网搜索引擎架构设计
    使用Windows系统的几个好的习惯
    静态页面对seo优化之详解
    让您SEO学习时间缩短一半的高阶秘籍
    java链表
    GAE 数据存储——事务
    GAE 博客——B3log Solo 0.2.0 发布了!
    Wine 1.3.7 发布
  • 原文地址:https://www.cnblogs.com/Fooo/p/1271044.html
Copyright © 2011-2022 走看看