Link to home
Start Free TrialLog in
Avatar of mwebster
mwebster

asked on

How to stop a CListCtrl from blinking

How can i stop a CListCtrl from excessively blinking when i call the DeleteAllItems() function
thanks in adVance
Avatar of rwilson032697
rwilson032697

Use the WM_SETREDRAW message to stop redrawing before you delete all the items, and again to enable it afterwards (you may need to force a repaint of the control).

The control mave have BeginUpdate and EndUpdate (or something similar) methods which  encapsulate this.

Cheers,

Raymond.
Avatar of mwebster

ASKER

can you send me some example code this CListCtrl is on a TabCtrl which is on a DialogBox(so you see my delima)
here's what i do to get a handle to the CListCtrl
      int index = m_Mytab.GetCurSel();
      TC_ITEM item;
      item.mask = TCIF_PARAM;
      m_Mytab.GetItem(index,&item);
      ASSERT(item.lParam);
        CListCtrl* MyCtrl = (CListCtrl*)item.lParam;
        MyCtrl->DeleteAllItems();



Actually use the SetRedraw method (thats the method equivalent I mentioned) od CListCtrl

eg:
MyCtrl->SetRedraw(FALSE);
MyCtrl->DeleteAllItems();
MyCtrl->SetRedraw(TRUE);

Cheers,

Raymond
Still didn't work i Still get the blicking when i switch from tab to tab cuz as i switch to each tab the data for the specific CListCtrl must be updated
ASKER CERTIFIED SOLUTION
Avatar of rwilson032697
rwilson032697

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial