Scrolling Child Windows In Subclassed CListCtrl
Posted on 1998-04-23
I want to use a CListCtrl in Report View to display audio items in column one and their respective volumes as horizontal sliders in column two. So I subclassed a CListCtrl and called it CSliderListCtrl. I have overridden the InsertItem() method which calls CListCtrl::InsertItem() and then goes on to create a CSliderCtrl and displays it in the RECT beside the newly inserted list item, i.e. in column two. But when the list needs to scroll, I have to explicitly call MoveWindow() for every slider in (and out of) view to get them to cleanly scroll alongside their correspondng list items. If each slider is a child window of my derived list control, why won't Windows do the scrolling and redrawing for me? My solution is a very clunky one and looks a bit sad on slower displays. Is there an alternative way? Maybe owner-drawn items?