Scroll issues on container in container scroll

Greetings,

I have few controls within containers and on the top of that the scroll bar for them, the issue is that if i want to scroll, the control works only if the mouse is above the scroll bar or near like 2 mm left and right , if i go on the control or the middle of the list does not work anymore .

So i have like that :

Main window -> PagePanel -> inside page panel i have the container control + the scroll bar ;

Then in the container control i have another container control which has a list box a text field and a label .

all in all it`s like a custom list box .

into the main container control mouseWheel event i have the following code

If scrollBar.Value >= 0 AND scrollBar.Value <= scrollBar.Maximum Then scrollBar.Value = scrollBarValue - deltaY End If

As well into the scrollbar MouseWheel action as well same code, on value changed i put the code to change the top value and the live scroll is checked.

What can be the issue ? and how can i fix this ?

Thanks .

@aurelian,

Is is possible that other controls may occupy the mouse events at first instead of the scrollbar ?
If you have embedded a listbox into the container and it’s underneath the scrollbar the listbox may receive the events first. It should explain why the scrollbar work on a different position. Could make a screenshot of the container ?

As well into the scrollbar MouseWheel action as well same code, on value changed i put the

I don’t think it’s necessary to use the mousewheel event of the scrollbar.

Well it seems that none of the controls in the container controls has that action so i guess the issue is not there .
Any more ideas ? i let the mouseWheel event only in one place in page panel so that i avoid issues and still same functionality

Should not web wheel event fire as long as the event happens into the control area ?

For example in my case the top most control is the page panel so if i remove all the mousewheel from all over and i let it only in page panel , logically it should fire as long as the mouse is within the area of that control.

Thanks.

Without the taking a look in the code, I don’t think it’s possible to be of further help.

Well i made a simple demo that is similar to what i have , so if you put your mouse next to the scrollbar it will work, if you go to the left of the controls within the panel it will work, the problem comes when the mouse is over the c1 controls it will not work or only temporary when the mouse is between them in the empty space. then it becomes inactive again .

demo file

Hope that it will help reproduce the issue .

Works as expected. I see no issues here. As I said before a listbox may occupy the mousewheel event which is the case in your demo.
If you’re scrolling and hitting a listbox in the middle the scrollwheel event stops and the listbox takes the event.

If you hide the listbox you’ll see that it scrolls. It’s the standard behavior.

I had the same issues for the NSScrollView but in obj-c you can work that out with the nextResponder chain. I would submit a feature request for the listbox. In case you disabled both scrollbars (h/v) it should not occupy the scrollwheel pass the event to the next responder too.