2013r2 Canvas.MouseScroll Not Firing

Using Xojo 2013r2, the Canvas.MouseScroll event does not seem to be firing in Windows when the mouse is scrolled. Is anyone else seeing this problem?

Assuming you mean #.mousewheel event…

Not sure if by design, but I think it’s because it never really gets focus. You can confirm by putting a textbox on the form and putting a mouseswheel event in that also. Even if the mouse is above the canvas, the textbox.mousewheel is going to be the one that fires. I even tried putting canvas.setfocus on mouseenter and mousemove events… neither actually set the focus on the canvas. Same difference when using rectangle.mousewheel too… it never fires (at least, that I tried).

Ah ha! Make sure the canvas control has “acceptfocus” enabled… then it will work!

On that note, if a control doesn’t accept focus… it appears the mousewheel event will never fire; therefore, controls such as the rectangle should not even include it.

Yes, I did mean the Canvas.MouseWheel event. In any case, having the canvas accept focus has no effect on the problem. The Canvas.MouseWheel event does not appear to be firing in Windows in 2013r2 whereas it does in 2013r1 with the exact same project file. It also works as expected in OS X from the same project file in 2013r2.

In reading about this problem in another thread, it appears that a Windows control needs to have focus beginning with 2013r2 for the MouseWheel event to fire. This code in the Canvas.MouseDown event fixed the problem for me:


me.setfocus doesnt work for all controls. I have a mouseWheel event for a rectangle and i cant get it to work.