PDA

Click to See Complete Forum and Search --> : ListBox Scroll Bar... Tough Question indeed.


Abu haider
Oct 28th, 2001, 09:41 PM
I am trying to understand the ScrollBar of a Listbox. Is it a window? It doesn't seem to have a Window handle of itself. Any body has any idea how to control it?

Well, let me tell you the actual problem. If I set capture to a list box, it won't scroll if you try to. It will, but the first time you click on the ScrollBar, the capture will be lost!

I would rather like to set the capture for the ScrollBar itself, but don't seem to have any way of abtaining the window handle :confused: of the ScrollBar.

Any Ideas?

Please?

jim mcnamara
Oct 29th, 2001, 04:16 AM
If you go into spy++ you'll see that the scroll bars for a listbox are graphical controls, like a label, not a window as you would expect.

The mousemove & click events are captured in terms of the rectangle of the listbox vs the position of the cursor. I don't have a suggestion, except to find another type of control. For example, use a textbox, and a vertical scroller to the side. Then you have to write code to support scrolling, multiple selects, and so on.

Abu haider
Oct 29th, 2001, 08:35 AM
Thanks Jim,
Well, as you can see, the ScrollBar being a lightweight control wouldn't have bothered me. But why do I loose the capture if I click on it? And why doesn't it Scroll as long the ListBox has the Capture? After all, it is part of the ListBox, if the message goes to ListBox, it should direct it to the ScrollBar isn't it?

Using a combination to mimic the ListBox is way too much for the small functionality I need here.

:(

Thanks Jim, let me see if I find any work around