CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Slow CListCtrl

  1. #1
    Join Date
    Feb 2005
    Location
    Madrid (Spain)
    Posts
    511

    Slow CListCtrl

    Hi.

    I need to put in a CListCtrl about 300.000 items but it is very slow.

    There are some way to work properly with this number of items?

    Now I am working in a loop as follow:

    1.- Read data from file (it is fast)
    2.- lstCtrl.InsertItem(...)
    3.- lstCtrl.SetItemText(...)

    I only need to put in a grid the file content: are ther other control faster?

    Thanks in advance!!

  2. #2
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: Slow CListCtrl

    You could try this

    Before you start loading
    Code:
    ListCtrl.SetRedraw (false);
    After you are done
    Code:
    ListCtrl.SetRedraw (true);
    ListCtrl.Invalidate ()
    Now the list control is not redrawn for each added item, but only 1 time after you are done.

  3. #3
    Join Date
    Jul 2002
    Posts
    2,543

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured