Link to home
Start Free TrialLog in
Avatar of devayani
devayani

asked on

CListCtrl events

I am using CListCtrl,as I am going to show thousands of items in it.
So I want to show it in parts so that process will not slow down.
So if I will add first some items in ListCtrl then on scroll down event
next block likewise.But I couldn't see any scroll down event for this
ListCtrl in classwizard.So which event I can use for this process?
Avatar of shaig
shaig
Flag of Afghanistan image

Every window hase scroll bar events, the list control has nothing special about it.
Avatar of devayani
devayani

ASKER

But I can't see it in classwizard.
ASKER CERTIFIED SOLUTION
Avatar of naveenkohli
naveenkohli

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
Here's the ticket:

1) Open class wizard
2) Goto Message map screen
3) Press Add Class button
4) Select New...
5) Give you class a name like CDynamicListCtrl
6) Select CListCtrl as base class
7) Goto member variables for your dialog
8) Select the CONTROL ID for your list control
9) Select Add variable
10) Give you variable a name like m_DynamicListCtrl
11) Select Control as Category
12) Select CDynamicListCtrl as Variable type
13) Select CDynamicListCtrl in the Class name of the Message Maps tab of the class wizard
14) Select the ON_WM_VSCROLL message
15) Include your CDynamicListCtrl in your dialog's header class
16) Add code for the OnVScroll in your CDynamicListCtrl class

Whew... That's it! To see that it is working, put a TRACE message in the scroll function.

Good Luck,
Steve