MouseWheel on canvas

on a window I have an mousewheel event

scrollbar.dragme(0,DeltaY) ((scrollbar is the container control))

which scrolls a rectangle in a container control and is working fine. But as soon as I click on that rectangle the mouse wheel is not working anymore.
The rectangle itself has a mousedown event and returns true, without returning true the scrollbar works.

What do I have to write so that the mousewheel on the window works after clicking an that rectangle?

Thanks, Marco

@Marco Weinrich — Returning true in this context means that you want to keep the event only for yourself and prevent the system from knowing that the mouse is down. But in many cases, you’d want to do some special stuff but still allow the click-down to be processed by the system, hence returning false instead. It won’t prevent your stuff from being executed.

thanks, but returning false on the mousedown prevents mousedrag on that rectangle from executing and the mousewheel event on the main window isn’t executed right either…

oh, in my mousedown event on that rectangle I have:

and then it returns that y to the mouse wheel event on the main window.

what do I have to write that this y is not returning to the main mouse wheel event?

@Marco Weinrich — Well I don’t see why you want to store the ‘y’ value in MouseDown in relation to MouseWheel. MouseWheel send you the coordinates and the ?x, ?y for the wheel. What else would you need?

I store the y in mousedown on the rectangle to subtract it from the position, so that when clicked on that rectangle to drag it, it does not set the top position to the mouse position. The y in the rectangle is relative to the rectangle.

@Marco Weinrich — Well I still don’t understand your reason but returning false from the MouseDown event should do the trick

ok thanks