PRB: CListCtrl Inserting Items Slow If in Icon ModesLast reviewed: July 10, 1997Article ID: Q149342 |
2.10 2.20 4.00 4.10
WINDOWS NT
kbprg kbprb kbcode
The information in this article applies to: - The Microsoft Foundation Classes (MFC) included with: Microsoft Visual C++, 32-bit Edition, versions 2.1, 2.2, 4.0, 4.1
SYMPTOMSInserting a large number of items into a CListCtrl simultaneously may take a long time if the control is in the LVS_ICON or LVS_SMALLICON modes.
RESOLUTIONBefore starting to insert the items, disable painting of the control and re-enable the painting when the insertions are done. For more information see the "Sample Code" section of this article.
STATUSThis behavior is by design.
MORE INFORMATIONA CListCtrl can display its contents in one of four styles: LVS_ICON, LVS_SMALLICON, LVS_LIST, or LVS_REPORT. The problem does not show up if the control is in the LVS_LIST or the LVS_REPORT modes.
Sample Code
//..... m_List.SetRedraw(FALSE); // turn drawing off regardless of list mode //.... //Insert the items //.... m_List.SetRedraw(TRUE); // turn drawing back on and update the window m_List.Invalidate(); m_List.UpdateWindow(); |
Additional reference words: 2.10 2.20 3.10 3.20 4.00 4.10 CListCtrl adding
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |