Scrolling your mouse wheel with Silverlight

Published 25 September 08 03:00 PM | Coding4Fun 

Tim Heuer found an interesting article by Adam Cooper on Silverlight and adding in support for your mouse’s scroll wheel

To do so, it pretty painless with Adam’s helper class.

XAML:

<ScrollViewer x:Name="MyScroller" Width="300" Height="100" Background="AliceBlue">
    <TextBlock TextWrapping="Wrap">
        Even if you use my workaround ...
    </TextBlock>
</ScrollViewer>

Page.xaml.cs example:

using Cooper.Silverlight.Controls;

public Page()
{
    InitializeComponent();
    ScrollViewerMouseWheelSupport.Initialize(this);
    MyScroller.AddMouseWheelSupport();
}

Adam has a few working demos, this one is showing off the scrollbar where the mouse is hovering over the needed scroll area.

image

Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# car insurance &raquo; Scrolling your mouse wheel with Silverlight said on September 25, 2008 6:21 PM:

PingBack from http://hoursfunnywallpaper.cn/?p=7883

# funny wallpaper &raquo; Scrolling your mouse wheel with Silverlight said on September 25, 2008 6:22 PM:

PingBack from http://housesfunnywallpaper.cn/?p=7593

# discount furniture &raquo; Scrolling your mouse wheel with Silverlight said on September 25, 2008 6:37 PM:

PingBack from http://informationsfunnywallpaper.cn/?p=7074

# a-foton &raquo; Scrolling your mouse wheel with Silverlight said on September 25, 2008 7:37 PM:

PingBack from http://blog.a-foton.ru/2008/09/scrolling-your-mouse-wheel-with-silverlight/

# RadioactivePete said on January 8, 2009 7:49 PM:

Works Awsome!!

Why wasn't something like this included in the first place.

Thanks for fixing this.

# Manfred said on March 15, 2009 8:22 AM:

It is also possible to extend Adam Coopers library a little to get ListBox and DataGrid scrolling support.

http://www.nystedberry.info/2009/03/silverlight-datagrid-listbox-mouse-scroll-support

Leave a Comment

(required) 
(optional)
(required) 

  
Enter Code Here: Required

Search

This Blog

Syndication

Page view tracker