How to avoid flickering in list control
-
Hi, I have list control whose property is set to "List1",IDC_CmdResp,"SysListView32",LVS_REPORT | WS_BORDER | WS_TABSTOP,293,37,146,214, WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE | WS_EX_RIGHT | WS_EX_STATICEDGE Am displaying the data read from the serial port in the list control but there is lot of filckering.Below is the code to display the data in list control.Is there any thing am missing in the code.Why there is flickering?More flickering starts when i start deleting the data.If i don't delete i get assert error that maybe due to memory overflow of the list control.Plz help me out. void CNgpptDialog::ReadSerialData(CString sIn) { CString pressure_data; ptrCmdResp->SetRedraw(false); pressure_data=sIn; int counter = ptrCmdResp->GetItemCount(); ptrCmdResp->InsertItem(counter, "");// to insert a row ptrCmdResp->SetItemText(counter, 0, pressure_data);// column0 ptrCmdResp->EnsureVisible(counter, FALSE); // Scrolls downwords. if(counter > 150)// I start deleting first data when the number of items in the list control is > 150 { ptrCmdResp->DeleteItem(0); } ptrCmdResp->SetRedraw(true); int nIndex = ptrCmdResp->GetItemCount(); ptrCmdResp->RedrawItems(nIndex,nIndex); } } Thanks in advance