I found this while working on some Deep Zoom stuff. It works there. I haven't time to put together an example so I don't know if it will help you in what you are trying to do. These event handlers are catching the mouse wheel event though, in a UserControl that I quickly threw together. (But I dought the logic in the handler is of much use to you.)
if ( HtmlPage.IsEnabled )
{
HtmlPage.Window .AttachEvent ( "DOMMouseScroll", HandleHtmlMouseWheel );
HtmlPage.Window .AttachEvent ( "onmousewheel", HandleHtmlMouseWheel );
HtmlPage.Document .AttachEvent ( "onmousewheel", HandleHtmlMouseWheel );
}
private void HandleHtmlMouseWheel ( object sender, HtmlEventArgs args )
{
double delta = 0;
ScriptObject eventObj = args.EventObject; if ( eventObj.GetProperty( "wheelDelta" ) != null )
{
delta = ((double)eventObj.GetProperty( "wheelDelta" ) ) / 120;
if ( HtmlPage.Window.GetProperty( "opera" ) != null )
delta = -delta;
} else if ( eventObj.GetProperty( "detail" ) != null )
{
delta = -((double)eventObj.GetProperty( "detail" ))/3;
if ( HtmlPage.BrowserInformation.UserAgent.IndexOf( "Macintosh" ) != -1 )
delta = delta * 3;
}
if ( delta != 0 )
{
MouseWheelEventArgs wheelArgs = new MouseWheelEventArgs ( delta );
if ( wheelArgs.Handled )
args.PreventDefault();
}
}
Hard Software, Done well.
(MFC, C#, Silverlight, Embedded, Desktop, Web services)
K2P2@subtopic.cc, www.subtopic.cc