[2005] listview column computation
i use timer control to compute the value of 2nd and 3rd column of a listview.
the problem is; the listview blinks everytime the timer perform computation.
the timer interval is 1;
kindly help me to avoid blinking of listview everytime it computes the value of 2nd and 3rd column?
Re: [2005] listview column computation
The SuspendLayout and ResumeLayout methods on the listview may help reduce your flicker.
Call the SuspendLayout, do your work, then call ResumeLayout.
Re: [2005] listview column computation
Quote:
the timer interval is 1;
That is very, very bad. You are performing your calculation 1000 times a second. It's not that the ListView blinks EACH time. The problem is that you're doing it so frequently that the ListView doesn't even get a chance to repaint some times. Be realistic about the frequency with which you perform this calculation.
What are you calculating anyway? It may be that you don't even need a Timer at all but can instead use an event to recalculate only when the result may have changed. That's far more efficient.
Re: [2005] listview column computation
Code:
Call the SuspendLayout, do your work, then call ResumeLayout.
how can i code or do it to avoid flickering?
Re: [2005] listview column computation
Quote:
Originally Posted by arshesander
Code:
Call the SuspendLayout, do your work, then call ResumeLayout.
how can i code or do it to avoid flickering?
DON'T UPDATE THE CONTROL 1000 TIMES PER SECOND.
Re: [2005] listview column computation
Instead of PMing me a few times, why don't you post what you have tried. Also, have you followed JMC's advice and lower the number of times you are refreshing the listview.
Noone is going to do the work for you, you need to make an effort and let us know the results.