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


C# Input.GetPosition方法代码示例

本文整理汇总了C#中Input.GetPosition方法的典型用法代码示例。如果您正苦于以下问题:C# Input.GetPosition方法的具体用法?C# Input.GetPosition怎么用?C# Input.GetPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Input的用法示例。


在下文中一共展示了Input.GetPosition方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnMouseMove

        protected override void OnMouseMove(Input.MouseEventArgs e)
        {
            base.OnMouseMove(e);

            if (startTracking)
            {                
                double diff = e.GetPosition(this).X - initialValue;
                initialValue = e.GetPosition(this).X;

                //Notify the curve needs to be redrawn...
                AnimationEditor editor = UIHelper.TryFindParent<AnimationEditor>(this);
                if (editor != null) {
                    editor.NotifyValueIncrement(diff);
                }   
            }
        }
开发者ID:phr34k,项目名称:System.Windows.Controls.Animation,代码行数:16,代码来源:AnimationValueLabel.cs

示例2: OnMouseMove

 internal override void OnMouseMove(Input.MouseEventArgs e)
 {
     base.OnMouseMove(e);
     if (!IsEnabled) return;
     if (!IsLeftButtonDown) return;
     if (timer != null) return;
     Point position = e.GetPosition(TreeView);
     if (position.Y < scrollBorderSize)
     {
         //scroll down
         ScrollContinously(-scrollDelta);
     }
     else if ((TreeView.RenderSize.Height - position.Y) < scrollBorderSize)
     {
         //scroll up
         ScrollContinously(scrollDelta);
     }
 }
开发者ID:YoshihiroIto,项目名称:TreeViewEx,代码行数:18,代码来源:AutoScroller.cs

示例3: OnMouseLeftButtonDown

 protected override void OnMouseLeftButtonDown(Input.MouseButtonEventArgs e)
 {
     base.OnMouseLeftButtonDown(e);
     startTracking = Mouse.Capture(this);
     initialValue = e.GetPosition(this).X;
 }
开发者ID:phr34k,项目名称:System.Windows.Controls.Animation,代码行数:6,代码来源:AnimationValueLabel.cs

示例4: OnMouseMove

 protected override void OnMouseMove(Input.MouseEventArgs e)
 {
     if (e.LeftButton == Input.MouseButtonState.Pressed && NavigationTriggerMode == Controls.NavigationTriggerMode.MouseDrag)
     {
         e.Handled = true;
         Point currentPosition = e.GetPosition(null);
         double baseX = _currentPageIndex * this.Width;
         double diffX = currentPosition.X - _mouseDragStartPosition.X;
         //foreach (FrameworkElement child in InternalChildren)
         //{
         //    TranslateTransform tt = child.RenderTransform as TranslateTransform;
         //    tt.X = baseX + diffX;
         //    tt.X = 500;
         //}
         _draggedDistance = diffX;
     }
     base.OnMouseMove(e);
 }
开发者ID:dotCtor,项目名称:WpfControls,代码行数:18,代码来源:FlexyPanel.cs

示例5: OnMouseDown

 protected override void OnMouseDown(Input.MouseButtonEventArgs e)
 {
     Keyboard.Focus(this);
     if (NavigationTriggerMode == Controls.NavigationTriggerMode.MouseClick)
     {
         if (e.LeftButton == Input.MouseButtonState.Pressed)
         {
             NavigateToPreviousPage();
         }
         else if (e.RightButton == Input.MouseButtonState.Pressed)
         {
             NavigateToNextPage();
         }
     }
     else if (NavigationTriggerMode == Controls.NavigationTriggerMode.MouseDrag)
     {
         _mouseDragStartPosition = e.GetPosition(null);
     }
     base.OnMouseDown(e);
 }
开发者ID:dotCtor,项目名称:WpfControls,代码行数:20,代码来源:FlexyPanel.cs


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