scroll-wheel problems with an owner-draw ListBox

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: me (me_at_here.com)
Date: 01/14/05


Date: Fri, 14 Jan 2005 20:14:15 +0000 (UTC)

Hi, i've written an owner-draw ListBox but I get some strange effects when
using the scroll-wheel to scroll the window.

If I set the type to "Fixed" the scroll-wheel causes the window to scroll
correctly but for some reason my MeasureItem function never gets called and
the items in the listbox are the wrong height (they just use some kind of
default value).

If I set the type to "Variable" the MeasureItem function gets called for
every item as expected and the listbox looks correct (all items are the
correct height). But when I use the scroll-wheel to scroll the window it
always scrolls downwards one whole page before stopping at the correct
window position.

A friend said that he might have seen this scroll behavior on some other
windows applications - is this a known problem? How come my MeasureItem
function doesn't get called (not even once) when the owner-draw type is set
to "Fixed"?

Is there a function I can call to set the "fixed" height manually?

Any help greatly appreciated!

Karl.



Relevant Pages

  • Re: Scrollbar thumbtrack doesnt scroll all the way
    ... SetWindowPos in regards to an embedded child window. ... Note also that OnSize is ... The size of the scroll bar in between is largely irrelevant to ... The correct value is to use nPos. ...
    (microsoft.public.vc.mfc)
  • Re: scroll-wheel problems with an owner-draw ListBox
    ... >every item as expected and the listbox looks correct (all items are the ... But when I use the scroll-wheel to scroll the window it ...
    (microsoft.public.vc.mfc)
  • Re: Scrollbar thumbtrack doesnt scroll all the way
    ... SetWindowPos in regards to an embedded child window. ... Note also that OnSize is ... The size of the scroll bar in between is largely irrelevant to ... The correct value is to use nPos. ...
    (microsoft.public.vc.mfc)
  • Re: GDI+ Custom Control
    ... I have actually done this already; my first MFC program was a medical data display and I ... First, I would treat each of the "tiles" as being a separate window, each a child window ... You scroll the tile. ... So there would be one "tile" for Heart ...
    (microsoft.public.win32.programmer.gdi)
  • Re: problems restoring previous scrollbar/window position with CListBox (newbie alert)
    ... It "kind of" works - The ListBox window will scroll to a position where the ... Using SelectString doesn't do this, in fact if an item is selected and then ...
    (microsoft.public.vc.mfc)