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

C# MouseButtons类代码示例

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

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



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

示例1: GameButton

 public GameButton(Buttons buttonCode)
 {
     this.keyCode = Keys.None;
     this.mouseCode = MouseButtons.None;
     this.buttonCode = buttonCode;
     this.inputType = InputType.Button;
 }
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:7,代码来源:GameButton.cs


示例2: MouseMove

 public override void MouseMove(IPosition p, MouseButtons b)
 {
     if (b == MouseButtons.Left)
     {
         RectUpdate(p);
     }
 }
开发者ID:steve-stanton,项目名称:backsight,代码行数:7,代码来源:ZoomRectangleTool.cs


示例3: HandleMouseDown

		public override void HandleMouseDown(Point mousePos, MouseButtons mouseButtons)
		{
			int clickedVisibleLine = (mousePos.Y + textArea.VirtualTop.Y) / textArea.TextView.FontHeight;
			int lineNumber = textArea.Document.GetFirstLogicalLine(clickedVisibleLine);
			
			if ((mouseButtons & MouseButtons.Right) == MouseButtons.Right) {
				if (textArea.Caret.Line != lineNumber) {
					textArea.Caret.Line = lineNumber;
				}
			}
			
			IList<Bookmark> marks = textArea.Document.BookmarkManager.Marks;
			List<Bookmark> marksInLine = new List<Bookmark>();
			int oldCount = marks.Count;
			foreach (Bookmark mark in marks) {
				if (mark.LineNumber == lineNumber) {
					marksInLine.Add(mark);
				}
			}
			for (int i = marksInLine.Count - 1; i >= 0; i--) {
				Bookmark mark = marksInLine[i];
				if (mark.Click(textArea, new MouseEventArgs(mouseButtons, 1, mousePos.X, mousePos.Y, 0))) {
					if (oldCount != marks.Count) {
						textArea.UpdateLine(lineNumber);
					}
					return;
				}
			}
			base.HandleMouseDown(mousePos, mouseButtons);
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:30,代码来源:IconBarMargin.cs


示例4: LinkLabelLinkClickedEventArgs

		public LinkLabelLinkClickedEventArgs (LinkLabel.Link link)
		{
#if NET_2_0
			this.button = MouseButtons.Left;
#endif
			this.link = link;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:7,代码来源:LinkLabelLinkClickedEventArgs.cs


示例5: SimulateClick

        // TODO:
        //public void SimulateScroll(int x, int y, int screenWidth, int screenHeight, scrollAmount)
        //public void SimulateScroll(scrollAmount)
        // TODO: Simulation which strips the ABSOLUTE factor from the mouse events, making the mouse NOT MOVE, for the click click.
        //public static void SimulateClick(MouseButtons mouseButton, int holdClickTime = 10)
        /// <summary>Simulates a mouse click at the specified location.</summary>
        /// <param name="x">The horizontal pixel coordinate to place the mouse cursor at.</param>
        /// <param name="y">The vertical pixel coordinate to place the mouse cursor at.</param>
        /// <param name="screenWidth">The current screen width (needed to scale the mouse cursor into position).</param>
        /// <param name="screenHeight">The current screen height (needed to scale the mouse cursor into position).</param>
        /// <param name="mouseButton">Which mouse button to simulate a click for.</param>
        /// <param name="holdClickTime">How long to simulate holding the mouse button down, in milliseconds.</param>
        /// <remarks>Basically this is just a pair of simulated mouse "down" and mouse "up" simulations in sequence.</remarks>
        public static void SimulateClick(int x, int y, int screenWidth, int screenHeight, MouseButtons mouseButton, int holdClickTime = 10)
        {
            VirtualMouseAction mouseDownOption, mouseUpOption;
            switch (mouseButton)
            {
                case MouseButtons.Left:
                    mouseDownOption = VirtualMouseAction.LeftButtonDown;
                    mouseUpOption = VirtualMouseAction.LeftButtonUp;
                    break;
                case MouseButtons.Middle:
                    mouseDownOption = VirtualMouseAction.MiddleButtonDown;
                    mouseUpOption = VirtualMouseAction.MiddleButtonUp;
                    break;
                case MouseButtons.Right:
                    mouseDownOption = VirtualMouseAction.RightButtonDown;
                    mouseUpOption = VirtualMouseAction.RightButtonUp;
                    break;
                default:
                    // TODO: Implement and test XButton1 and XButton2 with a fancy mouse.
                    throw new NotSupportedException("The selected mouse button is not yet supported: " + mouseButton.ToString());
            }

            Simulate(x, y, screenWidth, screenHeight, mouseDownOption);
            Thread.Sleep(holdClickTime);
            Simulate(x, y, screenWidth, screenHeight, mouseUpOption);
        }
开发者ID:KarakLive,项目名称:VirtualInput,代码行数:39,代码来源:VirtualMouse.cs


示例6: UpdateButtonState

        public void UpdateButtonState(MouseButtons button, ButtonState state)
        {
            if (button == MouseButtons.None || ButtonStates[button] == state && !_alwaysNotify) return;

            ButtonStates[button] = state;
            _doNotify = true;
        }
开发者ID:RuCaptain,项目名称:Neurolution,代码行数:7,代码来源:ControlStateListener.cs


示例7: MouseEventArgs

		public MouseEventArgs(MouseButtons button, int clicks, int x, int y, int delta) {
			this.buttons=button;
			this.clicks=clicks;
			this.delta=delta;
			this.x=x;
			this.y=y;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:7,代码来源:MouseEventArgs.cs


示例8: OnMouseUp

        private bool OnMouseUp(MouseButtons mouseButton,int shift,int x,int y)
        {
            if (this.TETool != null)
                this.TETool.OnMouseUp((int)System.Windows.Forms.MouseButtons.Right, shift, x,y);

            return true;
        }
开发者ID:hy1314200,项目名称:HyDM,代码行数:7,代码来源:TEHookHelper.cs


示例9: ClickPacket

 public ClickPacket(Point point, MouseButtons buttons, PressEvent pressEvent)
     : base(0x14)
 {
     Point = point;
     Buttons = buttons;
     PressEvent = pressEvent;
 }
开发者ID:rajeshwarn,项目名称:iDesktopVision,代码行数:7,代码来源:ClickPacket.cs


示例10: HandleMouseDown

        public override void HandleMouseDown(Point mousepos, MouseButtons mouseButtons)
        {
            try
            {
                bool showFolding = textArea.Document.TextEditorProperties.EnableFolding;
                int physicalLine = +(int)((mousepos.Y + textArea.VirtualTop.Y) / textArea.TextView.FontHeight);
                int realline = textArea.Document.GetFirstLogicalLine(physicalLine);

                // focus the textarea if the user clicks on the line number view
                textArea.Focus();

                if (!showFolding || realline < 0 || realline + 1 >= textArea.Document.TotalNumberOfLines)
                {
                    return;
                }

                List<FoldMarker> foldMarkers = textArea.Document.FoldingManager.GetFoldingsWithStart(realline);
                foreach (FoldMarker fm in foldMarkers)
                {
                    fm.IsFolded = !fm.IsFolded;
                }
                textArea.Document.FoldingManager.NotifyFoldingsChanged(EventArgs.Empty);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("in FoldMargin " + ex.Message);
            }
        }
开发者ID:pusp,项目名称:o2platform,代码行数:28,代码来源:FoldMargin.cs


示例11: base

	// Constructor.
	public StatusBarPanelClickEventArgs
				(StatusBarPanel statusBarPanel, MouseButtons button,
				 int clicks, int x, int y)
			: base(button, clicks, x, y, 0)
			{
				this.statusBarPanel = statusBarPanel;
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:8,代码来源:StatusBarPanelClickEventArgs.cs


示例12: OnMouseMove

 protected internal override void OnMouseMove(int X, int Y, MouseButtons mb)
 {
     if (Gumps.Capture == this)
     {
         Point point = ((Gump) this.m_Target).PointToScreen(new Point(0, this.m_Target.Height));
         Point point2 = base.PointToScreen(new Point(X, Y));
         int minWidth = ((point2.X - point.X) + 6) - this.m_xOffset;
         if (minWidth < this.m_Target.MinWidth)
         {
             minWidth = this.m_Target.MinWidth;
         }
         else if (minWidth > this.m_Target.MaxWidth)
         {
             minWidth = this.m_Target.MaxWidth;
         }
         bool flag = false;
         int num2 = point.Y - (point2.Y - this.m_yOffset);
         if (num2 < this.m_Target.MinHeight)
         {
             flag = true;
         }
         else if (num2 > this.m_Target.MaxHeight)
         {
             flag = true;
         }
         if (!flag)
         {
             this.m_Target.Height = num2;
             ((Gump) this.m_Target).Y = point2.Y - this.m_yOffset;
         }
         this.m_Target.Width = minWidth;
         Engine.Redraw();
     }
 }
开发者ID:Skinny1001,项目名称:PlayUO,代码行数:34,代码来源:GHTResizer.cs


示例13: Assign

        public DigitalButton Assign(MouseButtons button)
        {
            // Should it replace the assignment?
            this.mappingButtons.Add(button);

            return this;
        }
开发者ID:plaurin,项目名称:MonoGameEngine2D,代码行数:7,代码来源:DigitalButton.cs


示例14: DataListBeginDragEventArgs

 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="source">The source data list for the drag and drop operation</param>
 /// <param name="start">The selection start</param>
 /// <param name="end">The selection end</param>
 /// <param name="mouseButtons">The mouse button used</param>
 public DataListBeginDragEventArgs(DataList source, int start, int end, MouseButtons mouseButtons)
 {
     this.Source = source;
     this.SelectionStart = start;
     this.SelectionEnd = end;
     this.Button = mouseButtons;
 }
开发者ID:modulexcite,项目名称:ListControls,代码行数:14,代码来源:DataListBeginDragEventArgs.cs


示例15: mouseLeftButton_MouseFirstPressed

 void mouseLeftButton_MouseFirstPressed(MouseButtons mouseButton, MouseState mouseState, GameTime gameTime)
 {
     if (Rec.Contains(UI.GameEngine.Controller.mousePositionPoint))
     {
         _prevSpeedFactor = Context.Map.SpeedFactor;
     }
 }
开发者ID:HaKDMoDz,项目名称:geff,代码行数:7,代码来源:BPMMeter.cs


示例16: IsButtonDown

        public bool IsButtonDown(MouseButtons button)
        {
            if (button == MouseButtons.None)
                return false;

            return (_states[button] == ButtonState.Pressed);
        }
开发者ID:WhoBrokeTheBuild,项目名称:BaconJam2013,代码行数:7,代码来源:Input.cs


示例17: OnMousePressed

 /// <summary>Called when a mouse button has been pressed down</summary>
 /// <param name="button">Index of the button that has been pressed</param>
 protected override void OnMousePressed(MouseButtons button) {
   if(this.Enabled) {
     if(button == MouseButtons.Left) {
       this.pressedDownByMouse = true;
     }
   }
 }
开发者ID:pr0gramm3r1,项目名称:AngryTanks,代码行数:9,代码来源:PressableControl.cs


示例18: MouseEventExtArgs

 /// <summary>
 /// Initializes a new instance of the <see cref="MouseEventExtArgs"/> class. 
 /// </summary>
 /// <param name="buttons">One of the MouseButtons values indicating which mouse button was pressed.</param>
 /// <param name="clicks">The number of times a mouse button was pressed.</param>
 /// <param name="point">The x and y -coordinate of a mouse click, in pixels.</param>
 /// <param name="delta">A signed count of the number of detents the wheel has rotated.</param>
 /// <param name="timestamp">The system tick count when the event occurred.</param>
 /// <param name="isMouseKeyDown">True if event signals mouse button down.</param>
 /// <param name="isMouseKeyUp">True if event signals mouse button up.</param>
 internal MouseEventExtArgs(MouseButtons buttons, int clicks, Point point, int delta, int timestamp,  bool isMouseKeyDown, bool isMouseKeyUp)
     : base(buttons, clicks, point.X, point.Y, delta)
 {
     IsMouseKeyDown = isMouseKeyDown;
     IsMouseKeyUp = isMouseKeyUp;
     Timestamp = timestamp;
 }
开发者ID:nic0lae,项目名称:terminal,代码行数:17,代码来源:MouseEventExtArgs.cs


示例19: ButtonClick

 public void ButtonClick(MouseButtons Button)
 {
     //Check if it is a html link
     if(m_oAppDir[0] == (char)0x7F)
     {
         System.Diagnostics.Process.Start(m_oAppDir.Remove(0, 1));
     }
     else
     {
         try
         {
             if(Button == System.Windows.Forms.MouseButtons.Left)
             {
                 //This needs to be in a try catch in case the user cancels the process starting
                 System.Diagnostics.Process.Start(m_oAppDir + m_oAppName);
             }
             else if(Button == System.Windows.Forms.MouseButtons.Right)
             {
                 System.Diagnostics.Process.Start("explorer.exe", "/select, \"" + m_oAppDir + m_oAppName + "\"");
             }
         }
         catch
         {
         }
     }
 }
开发者ID:klaykree,项目名称:NewInterface,代码行数:26,代码来源:Clickable.cs


示例20: OnMouseUp

 protected internal override void OnMouseUp(int x, int y, MouseButtons mb)
 {
     if ((mb & MouseButtons.Right) != MouseButtons.None)
     {
         Gumps.Destroy(this);
     }
 }
开发者ID:Skinny1001,项目名称:PlayUO,代码行数:7,代码来源:GSkillIcon.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# MouseCursor类代码示例发布时间:2022-05-24
下一篇:
C# MouseButtonEventHandler类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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