Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CListCtrl flickering using EnsureVisible

174 views
Skip to first unread message

Gary

unread,
Nov 14, 2008, 4:29:01 PM11/14/08
to
Hi,

I am experiencing a problem with CListCtrl used in a form view.....
I see that it flickers...........

I am using EnsureVisible to see the last added items and I am using Redraw
items and SetRedraw to avoid flickering but nothing seems to be
working..........

incomingData.SetRedraw( FALSE );
incomingData.InsertItem( mItemsCount, _T("") );
incomingData.SetItemText( mItemsCount, 0, inData );

if (mItemsCount > 15)
{
incomingData.RedrawItems( mItemsCount - 15, mItemsCount );
incomingData.EnsureVisible( mItemsCount - 15, TRUE );
}

mItemsCount++;
incomingData.SetRedraw( TRUE );

Did anyone experience similar behavior ?
If so can you please tell me what else can be done to avoid flickering ?

AliR (VC++ MVP)

unread,
Nov 14, 2008, 5:00:01 PM11/14/08
to
I haven't had much luck with SetRedraw when it comes to List controls. But
I have had better luck with LockWindowUpdate and UnlockWindowUpdate.

BTW, why are you calling RedrawItems???

AliR.


"Gary" <Ga...@discussions.microsoft.com> wrote in message
news:B5A83A4C-A39F-4DB9...@microsoft.com...

Gary

unread,
Nov 14, 2008, 5:56:00 PM11/14/08
to
Lock and UnLock seem to be better than Redraw but I still see some minor
flickering........

Regarding RedrawItems......I was just trying to redraw portion of
items...but it was not useful...........

What else can I do to reduce the flickering ?.....
also CListCtrl supports upto 100million items right ?

AliR (VC++ MVP)

unread,
Nov 17, 2008, 10:30:20 AM11/17/08
to
I'm not sure what the maximum capacity of a list control is. But I must say
that if you are planing on displaying a large number of items, you might
want to look into using the the list control in Vitrual mode.

http://msdn.microsoft.com/en-us/library/ye4z8x58(VS.80).aspx

AliR.


"Gary" <Ga...@discussions.microsoft.com> wrote in message

news:11E3DD00-553B-45E6...@microsoft.com...

Gary

unread,
Nov 17, 2008, 1:34:04 PM11/17/08
to

Thanks a lot, I will give it a try.
0 new messages