• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Input.MouseEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



MouseEventArgs类属于System.Windows.Input命名空间,在下文中一共展示了MouseEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: mouseZone_MouseMove

        void mouseZone_MouseMove(object sender, MouseEventArgs e)
        {
            if (IsActive)
            {
                _viewport.Cursor = Cursors.None;

                var centerOfViewport = _viewport.PointToScreen(new Point(_viewport.ActualWidth / 2, _viewport.ActualHeight / 2));
                var relativePos = e.MouseDevice.GetPosition(_viewport);
                var actualRelativePos = new Point(relativePos.X - _viewport.ActualWidth / 2, _viewport.ActualHeight / 2 - relativePos.Y);
                var dx = actualRelativePos.X;
                var dy = actualRelativePos.Y;
                _yaw += dx;
                _pitch += dy;
                
                // Rotate
                Rotation = QuaternionHelper.EulerAnglesInDegToQuaternion(_pitch * Sensitivity * 0.1, _yaw * Sensitivity * 0.1, 0);
                
                // Set mouse position back to the center of the viewport in screen coordinates
                MouseUtilities.SetPosition(centerOfViewport);
            }
            else
            {
                _viewport.Cursor = Cursors.Arrow;
            }
        }
开发者ID:Inner-room,项目名称:VrPlayer,代码行数:25,代码来源:MouseTracker.cs


示例2: Slider_OnMouseMove

 private void Slider_OnMouseMove(object sender, MouseEventArgs e)
 {
     if (e.LeftButton == MouseButtonState.Pressed)
     {
         ui.ViewModel.WorkspaceViewModel.HasUnsavedChanges = true;
     }
 }
开发者ID:ankushraizada,项目名称:Dynamo,代码行数:7,代码来源:DynamoSlider.xaml.cs


示例3: myPath_MouseDown

 private void myPath_MouseDown(object sender, MouseEventArgs e)
 {
     mouseVerticalPosition = e.GetPosition(scene).Y;
     mouseHorizontalPosition = e.GetPosition(scene).X;
     isDragging = true;
     ((Path)sender).CaptureMouse();
 }
开发者ID:redliontom,项目名称:SWP2,代码行数:7,代码来源:AddEllipse.cs


示例4: OnMiddleMouseLeave

		void OnMiddleMouseLeave(object sender, MouseEventArgs e)
		{
			if (e.MiddleButton == MouseButtonState.Pressed)
			{
				MiddleButtonScrollHelper.StopScrolling();
			}
		}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:7,代码来源:GuardZonesView.xaml.cs


示例5: ListViewItem_MouseLeave

 public void ListViewItem_MouseLeave(object sender, MouseEventArgs e)
 {
     ListViewItem listViewItem = (ListViewItem)sender;
     MoveScore moveScore = (MoveScore)listViewItem.Content;
     var viewModel = DataContext as MainViewModel;
     viewModel.UnhighlightMove(moveScore.Move);
 }
开发者ID:MarkByers,项目名称:MyFishSolver,代码行数:7,代码来源:MainWindow.xaml.cs


示例6: OnThrottledMouseMove

 /// <summary>
 /// Raises the ThrottledMouseMove event
 /// </summary>
 protected void OnThrottledMouseMove(MouseEventArgs args)
 {
   if (ThrottledMouseMove != null)
   {
     ThrottledMouseMove(_element, args);
   }
 }
开发者ID:aleksanderkobylak,项目名称:oxyplot,代码行数:10,代码来源:ThrottledMouseEvent.cs


示例7: DoubleClickHandler

        public void DoubleClickHandler(object sender, MouseEventArgs e)
        {
            var selectedTraining = sender as ListBoxItem;
            var training = (Training)selectedTraining.DataContext;

            trainingSelectedEvent(training);
        }
开发者ID:amirben,项目名称:VideoTherapy,代码行数:7,代码来源:UC_TrainingProgramSelection.xaml.cs


示例8: OnMouseMove

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

            // if mouse button is not pressed we have no drag operation, ...
            if (e.LeftButton != MouseButtonState.Pressed)
                this.rubberbandSelectionStartPoint = null;

            // ... but if mouse button is pressed and start
            // point value is set we do have one
            if (this.rubberbandSelectionStartPoint.HasValue)
            {
                // create rubberband adorner
                AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this);
                if (adornerLayer != null)
                {
                    RubberbandAdorner adorner = new RubberbandAdorner(this, rubberbandSelectionStartPoint);
                    if (adorner != null)
                    {
                        adornerLayer.Add(adorner);
                    }
                }
            }
            e.Handled = true;
        }
开发者ID:ssickles,项目名称:archive,代码行数:25,代码来源:DesignerCanvas.cs


示例9: Button_MouseEnter

 private void Button_MouseEnter(object sender, MouseEventArgs e)
 {
     if (((Button)sender).Content != null)
     {
         ((Button)sender).Background = App.Current.Resources["PhoneBorderBrush"] as SolidColorBrush;
     }
 }
开发者ID:trofmike,项目名称:Balda-WP7,代码行数:7,代码来源:MainPage.xaml.cs


示例10: Grip_MouseMove

 private void Grip_MouseMove(object sender, MouseEventArgs e)
 {
     if (Grip.IsMouseCaptured)
     {
         this.Height = e.GetPosition(this).Y;
     }
 }
开发者ID:punker76,项目名称:VCA-player,代码行数:7,代码来源:MainWindow.xaml.cs


示例11: OnMouseMove

        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);
            if (e.LeftButton != MouseButtonState.Pressed)
                this.dragStartPoint = null;

            if (this.dragStartPoint.HasValue)
            {
                // XamlWriter.Save() has limitations in exactly what is serialized,
                // see SDK documentation; short term solution only;
                string xamlString = XamlWriter.Save(this.Content);
                DragObject dataObject = new DragObject();
                dataObject.Xaml = xamlString;

                WrapPanel panel = VisualTreeHelper.GetParent(this) as WrapPanel;
                if (panel != null)
                {
                    // desired size for DesignerCanvas is the stretched Toolbox item size
                    double scale = 1.3;
                    dataObject.DesiredSize = new Size(panel.ItemWidth * scale, panel.ItemHeight * scale);
                }

                DragDrop.DoDragDrop(this, dataObject, DragDropEffects.Copy);

                e.Handled = true;
            }
        }
开发者ID:ssickles,项目名称:archive,代码行数:27,代码来源:ToolboxItem.cs


示例12: OnGridPreviewMouseMove

        private void OnGridPreviewMouseMove(object sender, MouseEventArgs e)
        {
            if (CheckIgnoreGridMove.IsChecked == true && !IsButton1Source(e)) return;

            ShowStatus(nameof(OnGridPreviewMouseMove), e);
            e.Handled = CheckStopPreview.IsChecked == true;
        }
开发者ID:CNinnovation,项目名称:WPFWorkshopFeb2016,代码行数:7,代码来源:MainWindow.xaml.cs


示例13: contentView_PreviewMouseMove

        private void contentView_PreviewMouseMove(object sender, MouseEventArgs e)
        {
            var senderObj = sender as ScoreboardControl;

            if (senderObj == null)
            {
                // This shouldn't happen.
                return;
            }

            // Get the current mouse position
            Point mousePos = e.GetPosition(null);
            Vector diff = this.startPoint - mousePos;

            if (e.LeftButton == MouseButtonState.Pressed &&
                (Math.Abs(diff.X) > SystemParameters.MinimumHorizontalDragDistance ||
                Math.Abs(diff.Y) > SystemParameters.MinimumVerticalDragDistance))
            {
                string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "starboard.xbs");

               if (File.Exists(path) == false)
               {
                   return;
               }

                var strCol = new StringCollection { path };

                var o = new DataObject(DataFormats.FileDrop, strCol);
                o.SetFileDropList(strCol);
                DragDrop.DoDragDrop(senderObj, o, DragDropEffects.Copy);
            }
        }
开发者ID:ascendedguard,项目名称:starboard-dota2,代码行数:32,代码来源:ScoreboardControlPanelView.xaml.cs


示例14: OpenOperationEditWindow

        public void OpenOperationEditWindow(object sender, MouseEventArgs args)
        {
            if (OperationStopwatch != null && OperationStopwatch.ElapsedMilliseconds > 600)
            {
                operationCount = 0;
            }
            if (operationCount == 0)
            {
                OperationStopwatch = Stopwatch.StartNew();
                operationCount++;
            }
            else if (operationCount == 1)
            {
                int elapsedMilliseconds = (int)OperationStopwatch.ElapsedMilliseconds;
                operationCount = 0;
                if (elapsedMilliseconds <= (int)GetDoubleClickTime())
                {
                    TextBlock textBlock = sender as TextBlock;
                    ITestItemViewModel testItemViewModel = textBlock.DataContext as ITestItemViewModel;
                    ICommand editOperationCommand = testItemViewModel.EditOperationCommand;
                    editOperationCommand.Execute(null);

                }
            }
        }
开发者ID:philt5252,项目名称:GoldenHorse,代码行数:25,代码来源:TestDetailsView.xaml.cs


示例15: txbConfig_MouseEnter

 private void txbConfig_MouseEnter(object sender, MouseEventArgs e)
 {
     _descripcion =
         "Cambia el nombre de concurso, las cápsulas informativas, carga los equipos a concursar y las preguntas a usar; la cantidad de tiempo por pregunta y el número de ellas por ronda";
     txbDescripcion.Text = _descripcion;
     //imgPreview.Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + "..\\..\\config.png"));
 }
开发者ID:Maharba,项目名称:YACM,代码行数:7,代码来源:MainWindow.xaml.cs


示例16: Boat1_MouseEnter

 private void Boat1_MouseEnter(object sender, MouseEventArgs e)
 {
     if (playerProfile.CampaignProgress >=1)
     {
         StoryBlock.Text = "Fight the frost giants back!";
     }
 }
开发者ID:Bang-Bang-Studios,项目名称:Big-Sunday,代码行数:7,代码来源:MapPage.xaml.cs


示例17: OnMouseMove

        protected override void OnMouseMove(MouseEventArgs e)
        {
            if (downPoint != null)
            {
                Point dragPoint = e.GetPosition(this);

                if (dragPoint.Y > downPoint.Value.Y)
                {
                    this.SetIsDraggingUp(true);
                    this.SetIsDraggingDown(false);
                }
                else
                {
                    this.SetIsDraggingUp(false);
                    this.SetIsDraggingDown(true);
                }

                if (dragPoint.Y - downPoint.Value.Y > this.DragThreshold)
                {
                    downPoint = dragPoint;
                    Next();

                }

                else if (dragPoint.Y - downPoint.Value.Y < (this.DragThreshold * -1))
                {
                    downPoint = dragPoint;
                    Previous();
                }
            }

            base.OnMouseMove(e);
        }
开发者ID:x-skywalker,项目名称:Tasks.Show,代码行数:33,代码来源:DragSelector.cs


示例18: MenuPanel_MouseLeave

 private void MenuPanel_MouseLeave(object sender, MouseEventArgs e)
 {
     if (!IsActive)
     {
         VisualStateManager.GoToState(this, "MouseOut", true);
     }
 }
开发者ID:crystalbyte,项目名称:aquapool-web,代码行数:7,代码来源:MenuPanel.cs


示例19: picture_MouseEnter

 private void picture_MouseEnter(object sender, MouseEventArgs e)
 {
     Image image = sender as Image;
     if (image.Source == null)
         return;
     bigPic.Source = image.Source;
 }
开发者ID:DuBin1988,项目名称:anjian_phone_server,代码行数:7,代码来源:燃气表故障明细.xaml.cs


示例20: btn_MouseLeave

 private void btn_MouseLeave(object sender, MouseEventArgs e)
 {
     tb.Visibility = Visibility.Hidden;
     tb.Text = sPlaceHolder;
     pb.Visibility = Visibility.Visible;
     pb.Focus();
 }
开发者ID:Oscarin017,项目名称:TDA,代码行数:7,代码来源:TextBoxP.xaml.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Input.MouseWheelEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# Input.MouseButtonEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap