当前位置: 首页>>代码示例>>C#>>正文


C# Input.MouseWheelEventArgs类代码示例

本文整理汇总了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;
            }
        }
开发者ID:fcostacampos,项目名称:WPF-Magnifier,代码行数:30,代码来源:ImagingProvider.cs

示例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);
 }
开发者ID:jnhaffey,项目名称:Timekeeper,代码行数:7,代码来源:SeeThruListView.cs

示例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);
        }
开发者ID:aleksanderkobylak,项目名称:oxyplot,代码行数:7,代码来源:MouseAction.cs

示例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);
            }
        }
开发者ID:jasonjtyler,项目名称:XamDataGrid.Zoomable,代码行数:25,代码来源:MouseWheelZooming.cs

示例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;
 }
开发者ID:gdlprj,项目名称:duscusys,代码行数:7,代码来源:CustomTimelineWnd.xaml.cs

示例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;
            }
        }
开发者ID:kaushik1605,项目名称:sample_DotNet,代码行数:28,代码来源:SelectorHelper.cs

示例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.
            }
        }
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:32,代码来源:HistoryDetailsUserControl.xaml.cs

示例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.
        }
开发者ID:aweaver,项目名称:PicViewerWPF,代码行数:32,代码来源:Window1.xaml.cs

示例9: CProgressBar_MouseWheel

 private void CProgressBar_MouseWheel(object sender, MouseWheelEventArgs e)
 {
     if (e.Delta > 0)
         Value += Maximum * 0.02;
     else
         Value -= Maximum * 0.02;
 }
开发者ID:Satroki,项目名称:MusicWPF,代码行数:7,代码来源:Classes.cs

示例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;
        }
开发者ID:hardborn,项目名称:StadiumBrightnessTool,代码行数:7,代码来源:LocationProfileView.xaml.cs

示例11: MouseWheelInputEventArgs

 public MouseWheelInputEventArgs(IMouseWheelController controller, MouseWheel wheel, MouseWheelEventArgs nativeEventArgs)
   : base(nativeEventArgs.MouseDevice, nativeEventArgs.Timestamp)
 {
   Controller = controller;
   Wheel = wheel;
   NativeEventArgs = nativeEventArgs;
 }
开发者ID:heartszhang,项目名称:WeiZhi3,代码行数:7,代码来源:MouseWheelInputEventArgs.cs

示例12: OnMouseWheel

 protected override void OnMouseWheel(MouseWheelEventArgs e)
 {
     if (VerticalScrollBarVisibility != ScrollBarVisibility.Disabled)
     {
         base.OnMouseWheel(e);
     }
 }
开发者ID:nharren,项目名称:MusicTimeline,代码行数:7,代码来源:NonBlockingFlowDocumentScrollViewer.cs

示例13: img_MouseWheel

 private void img_MouseWheel(object sender, MouseWheelEventArgs e)
 {
     if (e.Delta > 0)
         IncreaseZoom();
     else
         DecreaseZoom();
 }
开发者ID:lapuasi,项目名称:china-unicom-player,代码行数:7,代码来源:ImagePage.xaml.cs

示例14: lbMatFile_MouseWheel

 public void lbMatFile_MouseWheel(object sender, MouseWheelEventArgs e)
 {
     if (scrollViewer != null)
     {
         scrollViewer.ScrollToVerticalOffset(scrollViewer.VerticalOffset - e.Delta);
     }
 }
开发者ID:tuyiherizon,项目名称:TableModifier,代码行数:7,代码来源:InnerStructItemList.xaml.cs

示例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);
     }
 }
开发者ID:Palethorn,项目名称:Scheduler,代码行数:30,代码来源:Tasks.xaml.cs


注:本文中的System.Windows.Input.MouseWheelEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。