Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to stop a CListCtrl from blinking

Posted on 1998-10-27
5
Medium Priority
?
1,175 Views
Last Modified: 2008-03-06
How can i stop a CListCtrl from excessively blinking when i call the DeleteAllItems() function
thanks in adVance
0
Comment
Question by:mwebster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1176359
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.
0
 

Author Comment

by:mwebster
ID: 1176360
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();



0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1176361
Actually use the SetRedraw method (thats the method equivalent I mentioned) od CListCtrl

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

Cheers,

Raymond
0
 

Author Comment

by:mwebster
ID: 1176362
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
0
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 400 total points
ID: 1176363
Then do the same thing when you populate the list controll with data: (perhaps you should do the clear and populate in the same redrw suppression:)

       MyCtrl->SetRedraw(FALSE);
       MyCtrl->DeleteAllItems();
       // Add all the bits to your control
       MyCtrl->SetRedraw(TRUE);

       Cheers,

       Raymond
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question