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


C# MouseEventHandler类代码示例

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


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

示例1: ColorButton

 public ColorButton()
 {
     MouseEnter += new EventHandler(OnMouseEnter);
     MouseLeave += new EventHandler(OnMouseLeave);
     MouseUp += new MouseEventHandler(OnMouseUp);
     Paint += new PaintEventHandler(ButtonPaint);
 }
开发者ID:novalis78,项目名称:Pali-Text-Reader,代码行数:7,代码来源:ColorButton.cs

示例2: InitializeEvents

        /// <summary>
        /// Initialize class events.
        /// </summary>
        private void InitializeEvents()
        {
            TextChanged += new EventHandler(HandleTextChanged);
            UpdateUI += new EventHandler<UpdateUIEventArgs>(HandleUpdateUI);

            // enable drag & drop
            AllowDrop = true;
            DragOver += new DragEventHandler(HandleDragOver);
            DragDrop += new DragEventHandler(HandleDragDrop);

            // search & replace
            KeyUp += new KeyEventHandler(HandleKeyUp);
            KeyDown += new KeyEventHandler(HandleKeyDown);
            InsertCheck += new EventHandler<InsertCheckEventArgs>(HandleInsertCheck);
            CharAdded += new EventHandler<CharAddedEventArgs>(HandleCharAdded);
            
            MouseWheel += new MouseEventHandler(HandleMouseWheel);
            Painted += new EventHandler<EventArgs>(HandlePainted);

            // create default pens
            grayPen = new Pen(Brushes.Gray);
            dashedPen = new Pen(Brushes.LightGray);
            dashedPen.DashPattern = new[] { 3f, 6f };

            // measure default line size
            lineSize = TextRenderer.MeasureText(new string('/', NewLineHelper), Font);
        }
开发者ID:h3tch,项目名称:ProtoFX,代码行数:30,代码来源:CodeEditor.Events.cs

示例3: SharpDevelopSideBar

		public SharpDevelopSideBar()
		{
			SideTabItemFactory = new SharpDevelopSideTabItemFactory();
			
			MouseUp                     += new MouseEventHandler(SetContextMenu);
			sideTabContent.MouseUp += new MouseEventHandler(SetItemContextMenu);
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:7,代码来源:SharpDevelopSideBar.cs

示例4: Init

		private void Init()
		{
			InitializeComponent();

			MouseUp += new MouseEventHandler(OnMouseUp);
			KeyUp += new KeyEventHandler(OnKeyUp);
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:7,代码来源:FeatureStructureTreeView.cs

示例5: OnMouseLeftButtonDown

        protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
        {
            //因为图钉是添加在MapLayer上的
            var parentLayer = this.Parent as MapLayer;
            if (parentLayer != null)
            {
                //MapLayer是Map的一个子对象
                var parentMap = parentLayer.ParentMap;
                if (parentMap != null)
                {
                    if (this.MapMouseDragHandler == null)
                    {
                        this.MapMouseDragHandler = new EventHandler<MapMouseDragEventArgs>(ParnetMap_MousePan);
                        parentMap.MousePan += this.MapMouseDragHandler;
                    }

                    if (this.MapMouseLeftButtonUpHandler == null)
                    {
                        this.MapMouseLeftButtonUpHandler = new MouseButtonEventHandler(PrentMap_MouseLeftButtonUp);
                        parentMap.MouseLeftButtonUp += this.MapMouseLeftButtonUpHandler;
                    }

                    if (this.MapMouseMoveHandler == null)
                    {
                        this.MapMouseMoveHandler = new MouseEventHandler(PrentMap_MouseMove);
                        parentMap.MouseMove += this.MapMouseMoveHandler;
                    }
                }
            }
            this.IsDragging = true;

            base.OnMouseLeftButtonDown(e);
        }
开发者ID:HogwartsRico,项目名称:AGS-PgRouting,代码行数:33,代码来源:DraggablePushpin.cs

示例6: VoiceToolstripButton

        public VoiceToolstripButton(VoiceService voices)
        {
            Voices = voices;

            ToolTipText = "Voice Chat";

            Paint += new PaintEventHandler(VoiceToolstripButton_Paint);

            ButtonClick += new EventHandler(VoiceToolstripButton_ButtonClick);
            MouseDown += new MouseEventHandler(VoiceToolstripButton_MouseDown);
            MouseUp += new MouseEventHandler(VoiceToolstripButton_MouseUp);
            OffButton = new ToolStripMenuItem("Off", Res.VoiceRes.VoiceOff, OffButton_Clicked);
            VoiceActivatedButton = new ToolStripMenuItem("Voice Activated", Res.VoiceRes.VoiceVAD, VoiceActivatedButton_Clicked);
            PushtoTalkButton = new ToolStripMenuItem("Push to Talk", Res.VoiceRes.VoicePTT, PushtoTalkButton_Clicked);
            MuteButton = new ToolStripMenuItem("Mute", Res.VoiceRes.VoiceMute, MuteButton_Clicked);
            SettingsButton = new ToolStripMenuItem("Settings", Res.VoiceRes.VoiceSettings, SettingsButton_Clicked);

            DropDownItems.Add(OffButton);
            DropDownItems.Add(VoiceActivatedButton);
            DropDownItems.Add(PushtoTalkButton);
            DropDownItems.Add(MuteButton);
            DropDownItems.Add(SettingsButton);

            WindowID = Voices.Core.RndGen.Next();

            Voices.RegisterWindow(WindowID, new VolumeUpdateHandler(VoiceService_VolumeUpdate));

            OffButton.PerformClick();
        }
开发者ID:RoelofSol,项目名称:DeOps,代码行数:29,代码来源:VoiceToolstripButton.cs

示例7: FormMoveHook

 public FormMoveHook(Form target)
 {
     form = target;
     mouseDownHandler = new MouseEventHandler(MouseDownHandler);
     mouseUpHandler = new MouseEventHandler(MouseUpHandler);
     mouseMoveHandler = new MouseEventHandler(MouseMovHandlere);
 }
开发者ID:nibomed,项目名称:Emoticoner,代码行数:7,代码来源:FormMove.cs

示例8: FractalView

        public FractalView()
        {
            fractalImageCacheInvalidated = true;

            MouseClick += new MouseEventHandler(GAPictureBox_Click);
            Paint += new PaintEventHandler(GAPanel_Paint);
        }
开发者ID:rrhvella,项目名称:thesis-mandelbrot-evolver,代码行数:7,代码来源:FractalView.cs

示例9: InitializeForm

		private void InitializeForm()
		{
			var mouseDoubleClick = new MouseEventHandler((sender, args) => { Process.Start((sender as TextBox).Text); });
			this.txtSourceRootDir.MouseDoubleClick += mouseDoubleClick;
			this.txtSourceRootDir2.MouseDoubleClick += mouseDoubleClick;
			this.txtSourceRootDir3.MouseDoubleClick += mouseDoubleClick;

			// Attach handler
			ProcessBehavior.PrintLog += AddLog;
			DbBehavior.PrintLog += AddLog;

			// set  the command line args.
			var commandLineArgs = Environment.GetCommandLineArgs();

			if (commandLineArgs.Count() == 3)
			{
				if (commandLineArgs[1].ToUpper() == "QA")
				{
					tabControl1.SelectedIndex = 1;
					this.txtSourceRootDir.Text = commandLineArgs[2];
				}
			}

			// QA 탭 감춤.
			tabControl1.SelectedTab.Visible = false;

			cboLanguage.SelectedIndex = 1;
			cbxClientCount.SelectedIndex = 0;
			cbxEnvironment.SelectedIndex = 0;

			//if (Screen.AllScreens.Length > 1)
			//{
			//	this.Location = new Point(Screen.AllScreens[1].WorkingArea.X, Screen.AllScreens[1].WorkingArea.Height - this.Height);
			//}
		}
开发者ID:josh-jeong,项目名称:Rhyme.Tools,代码行数:35,代码来源:FrmLoginTool.cs

示例10: MainForm

 public MainForm()
 {
     InitializeComponent();
     MouseEventHandler wheelHandler = null;
     wheelHandler = new MouseEventHandler(listBox_MouseWheel);
     eventListBox.MouseWheel += wheelHandler;
 }
开发者ID:ppatoria,项目名称:SoftwareDevelopment,代码行数:7,代码来源:MAIN.CS

示例11: ImageButton

 public ImageButton()
 {
     MouseMove  += new MouseEventHandler(ImageButton_MouseMove);
     MouseDown  += new MouseEventHandler(ImageButton_MouseDown);
     MouseLeave += new EventHandler(ImageButton_MouseLeave);
     MouseUp    += new MouseEventHandler(ImageButton_MouseUp);
 }
开发者ID:RoelofSol,项目名称:DeOps,代码行数:7,代码来源:ImageButton.cs

示例12: InitializeAutoC

 public void InitializeAutoC()
 {
     // auto completion settings
     AutoCSeparator = '|';
     AutoCMaxHeight = 9;
     MouseMove += new MouseEventHandler(HandleMouseMove);
 }
开发者ID:h3tch,项目名称:ProtoFX,代码行数:7,代码来源:CodeEditor.AutoC.cs

示例13: StartCapture

 /// <summary>
 /// 开始鼠标捕捉
 /// </summary>
 /// <param name="element"></param>
 /// <param name="mouseMoveHandler"></param>
 /// <param name="mouseUpHandler"></param>
 public static void StartCapture(this FrameworkElement element, MouseEventHandler mouseMoveHandler, 
     MouseButtonEventHandler mouseUpHandler)
 {
     element.MouseMove += mouseMoveHandler;
     element.MouseUp += mouseUpHandler;
     element.CaptureMouse();
 }
开发者ID:dalinhuang,项目名称:tdcodes,代码行数:13,代码来源:FrameworkElementExtension.cs

示例14: TriangleRegion

        public TriangleRegion(Image backgroundImage = null)
            : base(backgroundImage)
        {
            Angle = TriangleAngle.Top;

            MouseWheel += new MouseEventHandler(TriangleRegion_MouseWheel);
        }
开发者ID:modulexcite,项目名称:ZScreen_Google_Code,代码行数:7,代码来源:TriangleRegion.cs

示例15: DragPictureBox

        Dictionary<string, int> heldValues = new Dictionary<string, int>(); // Used to store a dictionary of held values which can be used by developers to attatch values to this DragPictureBox

        #endregion Fields

        #region Constructors

        // When a new instance of a DragPictureBox is created
        public DragPictureBox()
        {
            InitializeComponent(); // Initialize this DragPictureBox component
            followMouse.Tick += new EventHandler(followMouse_Tick); // Add the listener to the followMouse timer so that when it ticks it calls the followMouse_Tick method
            followMouse.Interval = 10; // Set the interval of the followMouse timer to 10 milliseconds
            MouseDown += new MouseEventHandler(MouseClicked); // Add a MouseDown listener to this DragPictureBox to call MouseClicked when the user clicks it.
        }
开发者ID:StefanKennedy,项目名称:Trillionaire,代码行数:14,代码来源:DragPictureBox.cs


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