Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to avoid flickering in list control

How to avoid flickering in list control

Scheduled Pinned Locked Moved C / C++ / MFC
helpperformancetutorialquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shir_k
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups