Sign in to follow this  
Clash

Scrolling Listbox w/ Children Controls

Recommended Posts

I've subclassed a variable owner draw listbox. I programmatically add a bunch of controls (edit, combo, and buttons) as children of the listbox. I position the controls only one time - right after they are created as children. They only scroll properly when a single scroll occurs (i.e. clicking on the "scroll up or down" button). If the user tries to drag the thumb or use the mousewheel the children controls move to some really large y position (and it keeps growing everytime you track the scrollbar). So my question boils down to, how do you add a child control to a listbox and have it respond to all types of scrolling properly?

Share this post


Link to post
Share on other sites
Hello,

You could probably use the WM_MOUSEWHEEL message to handle the wheel scrolling and WM_KEYDOWN(test which key is being pressed) to handle the keyboard scrolling.

Hope that helps.

Richard

Share this post


Link to post
Share on other sites
The problem is that windows somehow automatically scrolls the children of a listbox. The way that it does it doesn't seem to work with how I'm adding children controls to the listbox.

I'm curious what I'm missing about how windows works.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this