Try giving the control the extended style LVS_EX_DOUBLEBUFFER, but only when using comctl32 v6
(Unicode only).
Below is the code which closely resembles what I am trying to do -
CListCtrl m_list;
...
...
bool break = false;
vector<vector<CString>> list_vector;
vector<CString> item;
while(!break)
{
if( /*cursor moved*/ )
{
for(int i = 0; i< NoOfRows; i++)
{
item.push_back("Data1");
item.push_back("Data2");
item.push_back("Data3");
item.push_back("Data4");
item.push_back("Data5");
item.push_back("Data6");
list_vector.push_back(item);
}
std::sort( list_vector.begin(), list_vector.end(), SortList)
vector<vector<CString>>::iterator listItr;
m_list.SetRedraw(false);
for( listItr = list_vector.begin(); listItr != list_vector.end();
++listItr )
{
//code to insert vector items in list
}
m_list.SetRedraw(true);
}
...
...
if(/*some condtition*/)
break = true;
}
"Siddu" wrote:
Hi,
My application uses a dialog with CListCtrl in report view, this list
control gets updated heavily and frequently. To stop flickering during
update, I have used SetRedraw(FALSE) before the update operation, like-
This trick is working fine with Win XP, but its unable to stop flickering on
Vista.
I have also tried LockWindowUpdate(), but the problem remains.
Is there any known issue with using CListCtrl on Vista?
What else could be tried to stop Flickering?