ScrollWindowEx and WM_VSCROLL for a ListBox control

  • Thread starter Thread starter evan
  • Start date Start date
E

evan

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 "ShowScrollBar" 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_NCLBUTTONDOWN event
-> Will have to override WM_NCLBUTTONDOWN

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_NCLBUTTONDOWN
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
 
Back
Top