Reduce flicker in ListView ?
-
I have 20 items in my List View and I update them rapidly (change text of subitem) interval = 100millisecond (report type only) They are very flicker Is there a way to fix it ? VC6,XP thank a lot ~!
-
I have 20 items in my List View and I update them rapidly (change text of subitem) interval = 100millisecond (report type only) They are very flicker Is there a way to fix it ? VC6,XP thank a lot ~!
Have you looked at
CWnd::SetRedraw()
?
Five birds are sitting on a fence. Three of them decide to fly off. How many are left?
-
Have you looked at
CWnd::SetRedraw()
?
Five birds are sitting on a fence. Three of them decide to fly off. How many are left?
you can derive and write you own CView::OnUpdate() function... since CListView is derived from the CView Class. this will allow you to redraw only part of the View. The default OnUpdate() is to redraw the entire client area. This is exactly what you need to do to reduce flickering.
-
you can derive and write you own CView::OnUpdate() function... since CListView is derived from the CView Class. this will allow you to redraw only part of the View. The default OnUpdate() is to redraw the entire client area. This is exactly what you need to do to reduce flickering.
Two calls to
CWnd::SetRedraw()
takes far less code, however!
Five birds are sitting on a fence. Three of them decide to fly off. How many are left?
-
Two calls to
CWnd::SetRedraw()
takes far less code, however!
Five birds are sitting on a fence. Three of them decide to fly off. How many are left?
-
If you derive from CView you get more control over the drawing... you can set the icons and text descriptions to go with them. If you override the CWnd class then you cannot.
CListView is already derived from CView. More control over the drawing is not required, and I did not mention anything about "overriding the CWnd class", however you would do that. I'm assuming the OP had something akin to the following for populating the listview:
for (int x = 0; ...)
{
listview.InsertItem(...);
}Simply changing it to the following will keep the control from flickering:
listview.SetRedraw(FALSE);
for (int x = 0; ...)
{
listview.InsertItem(...);
}
listview.SetRedraw(TRUE);
Five birds are sitting on a fence. Three of them decide to fly off. How many are left?
-
CListView is already derived from CView. More control over the drawing is not required, and I did not mention anything about "overriding the CWnd class", however you would do that. I'm assuming the OP had something akin to the following for populating the listview:
for (int x = 0; ...)
{
listview.InsertItem(...);
}Simply changing it to the following will keep the control from flickering:
listview.SetRedraw(FALSE);
for (int x = 0; ...)
{
listview.InsertItem(...);
}
listview.SetRedraw(TRUE);
Five birds are sitting on a fence. Three of them decide to fly off. How many are left?