Silverlight : Handling mouse wheel without Javascript

Silverlight doesn't have direct support for mouse wheel.We have to use the HTML dom objects to accomplish the task.


//Subscribing to event
HtmlPage.Document.AttachEvent("onmousewheel", new EventHandler(onWheen));

void onWheel(object send,HtmlEventArgs arg)

{
object c= arg.EventObject.GetProperty("wheelDelta");
if (c != null)
{
int delta = int.Parse(c.ToString());
//Handle the action using delta
}
}


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: