我在用ListView控件时,动态地往里添加Item,此时ListView会不停闪烁,请问有何方法能防止闪烁?

解决方案 »

  1.   

    beginupdate()和endupdate()之间写代码
      

  2.   

    代码如下:
    ListView1.Items.BeginUpdate;ListView1.Items.Add('AAA');ListView1.Items.EndUpdate;
      

  3.   

    我需要每增加一个Item就要在界面上马上看到,如何操作?
      

  4.   

    添加大量结点时,没办法又要立即看见,又要不闪烁。
    with ListView1.Items do
        BeginUpdate;
          for i:=0 to 10000 do begin
              //添加操作
          end;    EndUpdate;
      

  5.   

    在OnCustomDrawItem或是OnCustomDrawSubItem事件中
    写这样一句话ListView1.DoubleBuffered := true;即可。