Mega Code Archive
Use the Mouse Wheel action methods that are defined by the IScrollInfo interface
IScrollInfo Interface Methods
Rectangle 3
//File:Window.xaml.cs
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Documents;
using System.Windows.Navigation;
using System.Text;
namespace ScrollViewer_Methods
{
public partial class Window1 : Window
{
private void onLoad(object sender, System.EventArgs e)
{
((IScrollInfo)sp1).CanVerticallyScroll = true;
((IScrollInfo)sp1).CanHorizontallyScroll = true;
((IScrollInfo)sp1).ScrollOwner = sv1;
}
private void spMouseWheelDown(object sender, RoutedEventArgs e)
{
((IScrollInfo)sp1).MouseWheelDown();
}
private void spMouseWheelUp(object sender, RoutedEventArgs e)
{
((IScrollInfo)sp1).MouseWheelUp();
}
private void spMouseWheelLeft(object sender, RoutedEventArgs e)
{
((IScrollInfo)sp1).MouseWheelLeft();
}
private void spMouseWheelRight(object sender, RoutedEventArgs e)
{
((IScrollInfo)sp1).MouseWheelRight();
}
}
}