ScrollWindowEx and WM_VSCROLL for a ListBox control

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • evan

    #1

    ScrollWindowEx and WM_VSCROLL for a ListBox control

    Hi,

    Is anyone able to give me an example on how to scroll the contents of
    a ListBox without forcing the user to click on the scroll up/down
    internal buttons?

    =============== ===============
    I am wanting to draw my own non-client area (including the scrollbar).
    I have had the following ideas but each idea has failed:

    1) Turn off the scrollbar using the "ShowScroll Bar" API
    -Turns off the scrollbar but no scrollbar functionality (for
    mousescroll etc.)...
    -Requires manually scrolling the Listbox contents

    2) Use WndProc to override WM_NCPAINT
    -The scrollbar and its buttons are still painted whenever the
    user clicks on it (WM_NCPAINT is not fired)
    -It is likely that the paint is occurring within the
    WM_NCLBUTTONDOW N event
    -Will have to override WM_NCLBUTTONDOW N

    3) Use WndProc to override WM_VSCROLL
    -Not able to scroll contents (what actually happens in
    WM_SCROLL? I am assuming it calls ScrollWindowEx)
    =============== ===============

    It would be most logical to handle the WM_NCPAINT and WM_NCLBUTTONDOW N
    events so that there is no redraw of the scrollbar and then fire my
    own WM_VSCROLL event.... then handle my own scrollbar and scrolling
    routines.

    Either way... does anyone please have an example of how to use
    ScrollWindowEx in VB .Net???

    /evan

Working...