本文整理汇总了C#中System.Windows.Input.MouseWheelEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# MouseWheelEventArgs类的具体用法?C# MouseWheelEventArgs怎么用?C# MouseWheelEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MouseWheelEventArgs类属于System.Windows.Input命名空间,在下文中一共展示了MouseWheelEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MouseWheel
public static void MouseWheel(Canvas c, TransformGroup tg, MouseWheelEventArgs e)
{
int deltaValue;
deltaValue = e.Delta;
TranslateTransform tt = (TranslateTransform)tg.Children[1];
ScaleTransform st = (ScaleTransform)tg.Children[0];
double xSpot = e.GetPosition(c).X;
double ySpot = e.GetPosition(c).Y;
Double x = e.GetPosition(c).X - tt.X;
Double y = e.GetPosition(c).Y - tt.Y;
Double centerX = st.CenterX * (st.ScaleX - 1);
Double centerY = st.CenterY * (st.ScaleY - 1);
st.CenterX = x;
st.CenterY = y;
if (deltaValue > 0)
{
st.ScaleX *= 1.25;
st.ScaleY *= 1.25;
}
else
{
st.ScaleX *= 0.75;
st.ScaleY *= 0.75;
}
}
示例2: SeeThruListView_PreviewMouseWheel
void SeeThruListView_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
{
e.Handled = true;
var e2 = new MouseWheelEventArgs(e.MouseDevice, e.Timestamp, e.Delta);
e2.RoutedEvent = UIElement.MouseWheelEvent;
RaiseEvent(e2);
}
示例3: PlotControl_MouseWheel
void PlotControl_MouseWheel(object sender, MouseWheelEventArgs e)
{
bool control = (Keyboard.IsKeyDown(Key.LeftCtrl));
bool shift = (Keyboard.IsKeyDown(Key.LeftShift));
OnMouseWheel(e.GetPosition(pc), e.Delta, control, shift);
}
示例4: PreviewMouseWheel
private static void PreviewMouseWheel(Object sender, MouseWheelEventArgs e)
{
if (Keyboard.Modifiers == ModifierKeys.Control)
{
Control zoomableControl = (Control)sender;
double zoomAmount = (double)zoomableControl.GetValue(ZoomAmountProperty);
double zoomMinimum = (double)zoomableControl.GetValue(ZoomMinimumProperty);
double zoomMaximum = (double)zoomableControl.GetValue(ZoomMaximumProperty);
if (e.Delta > 0)
zoomAmount *= 1.1;
else
zoomAmount *= 0.90909090909090906;
if (zoomAmount > zoomMaximum)
zoomAmount = zoomMaximum;
else if (zoomAmount < zoomMinimum)
zoomAmount = zoomMinimum;
zoomAmount = Math.Round(zoomAmount, 2);
zoomableControl.SetValue(ZoomAmountProperty, zoomAmount);
}
}
示例5: timelineView_MouseWheel_1
private void timelineView_MouseWheel_1(object sender, MouseWheelEventArgs e)
{
var delta = e.Delta < 0 ? 0.5 : -0.5;
var newZoom = zoomSlider.Value + delta;
if (zoomSlider.Minimum <= newZoom && newZoom <= zoomSlider.Maximum)
zoomSlider.Value = newZoom;
}
示例6: OnSelectorPreviewMouseWheel
private static void OnSelectorPreviewMouseWheel(object sender, MouseWheelEventArgs e)
{
if (e.Delta == 0)
{
// nothing to do
return;
}
var selector = (Selector)sender;
// get or stored scrollviewer
var lbScrollViewer = GetScrollViewer(selector);
if (lbScrollViewer != null)
{
var scrollingLines = GetScrollingLines(selector);
for (var i = 0; i < scrollingLines; i++)
{
if (e.Delta < 0)
{
lbScrollViewer.LineDown();
}
else
{
lbScrollViewer.LineUp();
}
}
e.Handled = true;
}
}
示例7: ScrollViewer_PreviewMouseWheel
/// <summary>
/// Handles the PreviewMouseWheel event of the ScrollViewer control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="MouseWheelEventArgs"/> instance containing the event data.</param>
private void ScrollViewer_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
{
try
{
var scrollviewer = sender as ScrollViewer;
if (e.Delta > 0)
{
if (scrollviewer != null)
{
scrollviewer.LineUp();
}
}
else
{
if (scrollviewer != null)
{
scrollviewer.LineDown();
}
}
e.Handled = true;
}
catch
{
// Do nothing.
}
}
示例8: OnPreviewMouseWheel
protected override void OnPreviewMouseWheel(MouseWheelEventArgs args)
{
base.OnPreviewMouseWheel(args);
Transform temptransform;
// Debug.WriteLine("Mouse wheel " + args.Delta);
// ImageDisp.LayoutTransform=new ScaleTransform(2.0,2.0) ;
if (args.Delta > 0)
dScale+=0.10;
if (args.Delta < 0)
{
dScale -= 0.10;
if (dScale < 1.0)
dScale = 1.0;
}
//Debug.WriteLine(" dScale " +dScale);
//Debug.WriteLine(" ImageDisp.LayoutTransform " + ImageDisp.LayoutTransform);
ImageDisp.RenderTransform = new ScaleTransform(dScale, dScale,(double)(pixelwidth / 2.0f), (double)(pixelheight / 2.0f));
ImageDisp.
Debug.WriteLine("Transform");
Debug.WriteLine("W " + bmpImage.PixelWidth + " H " + bmpImage.PixelHeight);
Debug.WriteLine("Dpi X " + bmpImage.DpiX + " Dpi Y " + bmpImage.DpiY);
Debug.WriteLine("Source X " + bmpImage.SourceRect.X + " Source Y " + bmpImage.SourceRect.Y);
// ImageDisp.InvalidateMeasure();
//ImageDisp.InvalidateVisual();
//ImageDisp.
}
示例9: CProgressBar_MouseWheel
private void CProgressBar_MouseWheel(object sender, MouseWheelEventArgs e)
{
if (e.Delta > 0)
Value += Maximum * 0.02;
else
Value -= Maximum * 0.02;
}
示例10: ItemsControl_MouseWheel
private void ItemsControl_MouseWheel(object sender, MouseWheelEventArgs e)
{
var x = Math.Pow(2, e.Delta / 3.0 / Mouse.MouseWheelDeltaForOneLine);
_zoomableCanvas.Scale *= x;
e.Handled = true;
}
示例11: MouseWheelInputEventArgs
public MouseWheelInputEventArgs(IMouseWheelController controller, MouseWheel wheel, MouseWheelEventArgs nativeEventArgs)
: base(nativeEventArgs.MouseDevice, nativeEventArgs.Timestamp)
{
Controller = controller;
Wheel = wheel;
NativeEventArgs = nativeEventArgs;
}
示例12: OnMouseWheel
protected override void OnMouseWheel(MouseWheelEventArgs e)
{
if (VerticalScrollBarVisibility != ScrollBarVisibility.Disabled)
{
base.OnMouseWheel(e);
}
}
示例13: img_MouseWheel
private void img_MouseWheel(object sender, MouseWheelEventArgs e)
{
if (e.Delta > 0)
IncreaseZoom();
else
DecreaseZoom();
}
示例14: lbMatFile_MouseWheel
public void lbMatFile_MouseWheel(object sender, MouseWheelEventArgs e)
{
if (scrollViewer != null)
{
scrollViewer.ScrollToVerticalOffset(scrollViewer.VerticalOffset - e.Delta);
}
}
示例15: scroll
public void scroll(object sender, MouseWheelEventArgs args)
{
if (!scrolling)
{
if (args.Delta < 120)
{
scrollAnimation.From = Canvas.GetTop(tasksItemsControl);
if (space < tasksItemsControl.Items.Count)
{
scrollAnimation.To = Canvas.GetTop(tasksItemsControl) - 98;
space++;
}
}
else
{
scrollAnimation.From = Canvas.GetTop(tasksItemsControl);
if (space > 0)
{
scrollAnimation.To = Canvas.GetTop(tasksItemsControl) + 98;
space--;
}
}
scrollAnimation.Completed += new EventHandler((o, a) =>
{
scrolling = false;
});
scrolling = true;
tasksItemsControl.BeginAnimation(Canvas.TopProperty, scrollAnimation);
}
}