The IE HTML Edit control does not automatically handle the MouseWheel as the IE browser controls does. In
Help Builder's HTML editing this feels like a missing feature, so I decided to add this tonight.
The solution shown below is pretty simple, but I've never worked with the mouse wheel before and couldn't figure out how to scroll the thing properly. The wheel works by giving you a WheelDelta value which is a multiple of 120 either positive or negative. The size of the value determines how hard the wheel was spun.
One thing that got me was that the positive numbers work the opposite I expected them too - spinning the wheel away from you is a positive value while spinning towards you is negative. For scrolling this is exactly the opposite you'd expect and it took me a while to figure out why my scroll kept scrolling and bouncing back. The solution here is to multiply by -1 (or whatever multiplier).
The multiplier is 120 which I guess corresponds roughly to 120 pixels scrolled. When I originally tried to get this to work (because I had problems with ScrollBy) i tried to use move the Selection and 120 pixels was exactly the right size. With the scrolling the parentWindow however 120 was a bit to much of a jump per scroll, so I reduced the sensitivity some by multiplying by -.8.
Here's the code:
PROCEDURE HTMLTextContainerEvents_onmousewheel() AS LOGICAL
loEvent = this.GetEventObject()
IF ISNULL(loEvent)
RETURN
ENDIF
lnWheelDelta = loEvent.WheelDelta
this.oDoc.parentWindow.Scrollby(0, INT(-.8
ENDPROC
Easy when you know what you need <g>...