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


C# MouseButtonEventArgs类代码示例

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


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

示例1: MouseButtonUp

 public override void MouseButtonUp(MouseButtonEventArgs args)
 {
     if (PointInside (args.X, args.Y)) {
         Console.WriteLine ("Activating!");
         OnActivate ();
     }
 }
开发者ID:directhex,项目名称:scsharp,代码行数:7,代码来源:GrpButtonElement.cs

示例2: OnListBoxDoubleClick

 private void OnListBoxDoubleClick(object sender, MouseButtonEventArgs args)
 {
     var listBoxItem = args.Source as System.Windows.Controls.ListBoxItem;
     if (listBoxItem != null && CanDoubleClick(listBoxItem))
     {
         ListBoxDoubleClick(listBoxItem);
     }
 }
开发者ID:unicloud,项目名称:FRP,代码行数:8,代码来源:ListBoxDoubleClickHelper.cs

示例3: OnListBoxDoubleClick

 private void OnListBoxDoubleClick(object sender, MouseButtonEventArgs args)
 {
     var listBoxItem = args.Source as RadListBoxItem;
     if (listBoxItem != null && CanDoubleClick(listBoxItem))
     {
         ListBoxDoubleClick(listBoxItem);
     }
 }
开发者ID:unicloud,项目名称:FRP,代码行数:8,代码来源:RadListBoxDoubleClickHelper.cs

示例4: Mouse

        public Mouse( IWindow window )
        {
            w = window.Handle as OpenTK.GameWindow;
            w.Mouse.ButtonDown += Mouse_ButtonDown;
            w.Mouse.ButtonUp += Mouse_ButtonUp;
            w.Mouse.Move += Mouse_Move;
            w.Mouse.WheelChanged += Mouse_WheelChanged;

            buttonEvent = new MouseButtonEventArgs ( GetState () );
            wheelEvent = new MouseWheelEventArgs ( 0 );
        }
开发者ID:Daramkun,项目名称:Misty,代码行数:11,代码来源:Mouse.cs

示例5: CommandsButton_MouseDown

 // ======================================================
 private void CommandsButton_MouseDown(object sender, MouseButtonEventArgs e)
 {
     if (((Button) sender).Text == "Show Commands") {
         ((Button) sender).Text = "Hide Commands";
         commandsLabel.Visible = true;
     }
     else {
         ((Button) sender).Text = "Show Commands";
         commandsLabel.Visible = false;
     }
 }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:12,代码来源:LevelUIHandler.cs

示例6: OnCharacterSelect

        /// <summary>
        /// Since character selection at the moment is the final stage in the menus, this loads the new level based on the previous
        /// level selection and current character selection
        /// </summary>
        void OnCharacterSelect(Button button, MouseButtonEventArgs eventArgs, string characterSelection)
        {
            if (LKernel.Get<MainMenuUIHandler>().GameType == GameTypeEnum.SinglePlayer) {
                this.characterSelection = characterSelection;

                LevelChangeRequest request = new LevelChangeRequest() {
                    NewLevelName = levelSelection,
                    CharacterNames = new string[] { characterSelection },
                    IsMultiplayer = false,
                };
                LKernel.GetG<LevelManager>().LoadLevel(request);
            }
        }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:17,代码来源:MainMenuSinglePlayerHandler.cs

示例7: Mouse

        public Mouse( IWindow window )
        {
            this.window = window;

            Form w = window.Handle as Form;

            w.MouseDown += ButtonDownEvent;
            w.MouseUp += ButtonUpEvent;
            w.MouseMove += MoveEvent;
            w.MouseWheel += WheelEvent;
            w.MouseHover += HoverEvent;
            w.MouseLeave += LeaveEvent;

            buttonEvent = new MouseButtonEventArgs ( new MouseState () );
            wheelEvent = new MouseWheelEventArgs ( 0 );
        }
开发者ID:Daramkun,项目名称:Misty,代码行数:16,代码来源:Mouse.cs

示例8: MouseEventToKeyName

 string MouseEventToKeyName(MouseButtonEventArgs e)
 {
     if (e.Button == MouseButton.PrimaryButton)
     {
         return "leftmousebutton";
     }
     if (e.Button == MouseButton.MiddleButton)
     {
         return "middlemousebutton";
     }
     if (e.Button == MouseButton.SecondaryButton)
     {
         return "rightmousebutton";
     }
     return "";
 }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:16,代码来源:KeyFilterSdlConfigMappings.cs

示例9: btnAccept_Click

 void btnAccept_Click(object sender, MouseButtonEventArgs e)
 {
     Messenger.SendAddSignRequest(txtHouse1.Text, txtHouse2.Text, txtHouse3.Text);
     MenuSwitcher.CloseAllMenus();
     Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
 }
开发者ID:ChaotixBluix,项目名称:PMU-Client,代码行数:6,代码来源:mnuAddSign.cs

示例10: AllowMouseLeftButtonDown

        /// <summary>
        /// Check if the control's MouseLeftButtonDown event should be handled.
        /// </summary>
        /// <param name="e">Event arguments.</param>
        /// <returns>
        /// A value indicating whether the event should be handled.
        /// </returns>
        public bool AllowMouseLeftButtonDown(MouseButtonEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e");
            }

            bool enabled = Control.IsEnabled;
            if (enabled)
            {
                // Get the current position and time
                DateTime now = DateTime.UtcNow;
                Point position = e.GetPosition(Control);

                // Compute the deltas from the last click
                double timeDelta = (now - LastClickTime).TotalMilliseconds;
                Point lastPosition = LastClickPosition;
                double dx = position.X - lastPosition.X;
                double dy = position.Y - lastPosition.Y;
                double distance = dx * dx + dy * dy;

                // Check if the values fall under the sequential click temporal
                // and spatial thresholds
                if (timeDelta < SequentialClickThresholdInMilliseconds &&
                    distance < SequentialClickThresholdInPixelsSquared)
                {
                    ClickCount++;
                }
                else
                {
                    ClickCount = 1;
                }

                // Set the new position and time
                LastClickTime = now;
                LastClickPosition = position;

                // Raise the event
                IsPressed = true;
            }
            else
            {
                ClickCount = 1;
            }

            return enabled;
        }
开发者ID:5nophilwu,项目名称:S1Nyan,代码行数:54,代码来源:InteractionHelper.cs

示例11: onScrollBack

 public void onScrollBack(object sender, MouseButtonEventArgs e)
 {
     Value -= SmallIncrement;
 }
开发者ID:jpbruyere,项目名称:Crow,代码行数:4,代码来源:ScrollBar.cs

示例12: MouseButtonUp

 public override void MouseButtonUp(MouseButtonEventArgs args)
 {
     if (PointInside (args.X, args.Y))
         OnActivate ();
 }
开发者ID:directhex,项目名称:scsharp,代码行数:5,代码来源:ButtonElement.cs

示例13: Events_MouseButtonUp

 void Events_MouseButtonUp(object sender, MouseButtonEventArgs e)
 {
     if (MouseUp != null)
     {
         MouseUp(sender, e);
     }
 }
开发者ID:hughperkins,项目名称:SpringMapDesigner,代码行数:7,代码来源:RendererSdl.cs

示例14: btnMyHouse_Click

 void btnMyHouse_Click(object sender, MouseButtonEventArgs e)
 {
     Messenger.SendHouseVisitRequest(Players.PlayerManager.MyPlayer.Name);
     MenuSwitcher.CloseAllMenus();
     Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
 }
开发者ID:ChaotixBluix,项目名称:PMU-Client,代码行数:6,代码来源:mnuVisitHouse.cs

示例15: MainPage_MouseLeftButtonUp

        void MainPage_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            // If the Canvas containing the TextBox is visible, ignore
            // this event.
            /*
            if (TextBoxCanvas.Visibility == Visibility.Visible)
            {
                return;
            }

            // Save the location where the user touched the screen.
            pointOnScreen = e.GetPosition(LayoutRoot);

            // Save the device attitude when the user touched the screen.
            attitude = motion.CurrentValue.Attitude.RotationMatrix;

            // Make the Canvas containing the TextBox visible and
            // give the TextBox focus.
            TextBoxCanvas.Visibility = Visibility.Visible;
            txtName.Focus();
             */
        }
开发者ID:aelatgt,项目名称:embedded-win8-webapp-test,代码行数:22,代码来源:MainPage.xaml.cs


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