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

C# MouseEventHandler类代码示例

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

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



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


示例16: GenerateAveResultTabPage

 public void GenerateAveResultTabPage(MouseEventHandler MouseDoubleClickHandle)
 {
     //TabPage tp = new TabPage(tpName);
     //TabControl tc = new TabControl();
     //tp.Controls.Add(tc);
     //tc.Dock = DockStyle.Fill;
    // DataSet ds = new DataSet();
     foreach (KeyValuePair<string, DataTable> rel in m_result)
     {
         TabPage subTabPage = new TabPage(rel.Key);
         //ds.Tables.Add(m_gsmDataTabel["CellAverageResult"]);
         DataGridView dgv = new DataGridView();
         dgv.ReadOnly = true;
         dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
         dgv.DataSource = m_result[rel.Key];
         dgv.Dock = DockStyle.Fill;
         //dgv.DataMember = "CellAverageResult";
         subTabPage.Text = rel.Key;
         subTabPage.Controls.Add(dgv);
         tcAveResults.Controls.Add(subTabPage);
         //tc.Controls.Add(subTabPage);
         //return tp;
     }
     
     
     
 }
开发者ID:xiaoyj,项目名称:Space,代码行数:27,代码来源:CellAverageResultForm.cs


示例17: MyForm

        /// <summary> The Constructor for our application</summary>
        MyForm()
        {
            //Initial settings for our Form window
            Size = new Size(400, 300);
            Text = " Collision on Either Side";
            BackColor = Color.Black;
            CenterToScreen();

            /// <remarks>Turn on double-buffering to eliminate flickering </remarks>
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.DoubleBuffer, true);

            /// <remarks>Create Paint Event Handler:
            /// fired every time Windows says it's time to repaint the Form. </remarks>
            Paint += new PaintEventHandler(DrawStuff);

            /// <remarks>Creates a new mouse movement event handler </remarks>
            MouseMove += new MouseEventHandler(MouseMoveUpdate);

            ZoneLeft = ZoneX - (ZoneWidth / 2); // The left side is half the Width to the left of Center
            ZoneRight = ZoneX + (ZoneWidth / 2); // Half the Width to the right
            ZoneTop = ZoneY - (ZoneHeight / 2); // obviously this must turn seaweed into fertilizer
            ZoneBottom = ZoneY + (ZoneHeight / 2);
        }
开发者ID:JeremiahZhang,项目名称:AKA,代码行数:26,代码来源:Program.cs


示例18: TextBox

		public TextBox() {

			scrollbars = RichTextBoxScrollBars.None;
			alignment = HorizontalAlignment.Left;
			this.LostFocus +=new EventHandler(TextBox_LostFocus);
			this.RightToLeftChanged += new EventHandler (TextBox_RightToLeftChanged);
			MouseWheel += new MouseEventHandler (TextBox_MouseWheel);

			BackColor = ThemeEngine.Current.ColorControl;
			ForeColor = ThemeEngine.Current.ColorControlText;
			backcolor_set = false;

			SetStyle (ControlStyles.StandardClick | ControlStyles.StandardDoubleClick, false);
			SetStyle (ControlStyles.FixedHeight, true);

			undo = new MenuItem(Locale.GetText("&Undo"));
			cut = new MenuItem(Locale.GetText("Cu&t"));
			copy = new MenuItem(Locale.GetText("&Copy"));
			paste = new MenuItem(Locale.GetText("&Paste"));
			delete = new MenuItem(Locale.GetText("&Delete"));
			select_all = new MenuItem(Locale.GetText("Select &All"));

			menu = new ContextMenu(new MenuItem[] { undo, new MenuItem("-"), cut, copy, paste, delete, new MenuItem("-"), select_all});
			ContextMenu = menu;

			menu.Popup += new EventHandler(menu_Popup);
			undo.Click += new EventHandler(undo_Click);
			cut.Click += new EventHandler(cut_Click);
			copy.Click += new EventHandler(copy_Click);
			paste.Click += new EventHandler(paste_Click);
			delete.Click += new EventHandler(delete_Click);
			select_all.Click += new EventHandler(select_all_Click);

			document.multiline = false;
		}
开发者ID:Profit0004,项目名称:mono,代码行数:35,代码来源:TextBox.cs


示例19: ImagePreview

        public ImagePreview(Control parent, MouseEventHandler parentmouse, MouseEventHandler parentclick, MouseEventHandler parentdoubleclick, InternetImage img)
        {
            InitializeComponent();
            m_random = new Random().Next(256);

            //this.BackColor = System.Drawing.Color.Black;
            //this.Location = new System.Drawing.Point(positionx*(128+8)+4, positiony*(128+16+4+8)+4);
            //this.Bounds = new Rectangle(new System.Drawing.Point(positionx * (128 + 8) + 4, positiony * (128 + 16 + 4 + 8) + 4), Size);
            this.MouseMove += new MouseEventHandler(parentmouse);
            this.MouseClick += new MouseEventHandler(parentclick);
            this.MouseDoubleClick += new MouseEventHandler(parentdoubleclick);
            this.MouseOverPanel.MouseMove += new System.Windows.Forms.MouseEventHandler(parentmouse);
            this.ImagePanel.MouseMove += new System.Windows.Forms.MouseEventHandler(parentmouse);
            this.ImagePanel.MouseClick += new MouseEventHandler(parentclick);
            this.ImagePanel.MouseDoubleClick += new MouseEventHandler(parentdoubleclick);
            this.Description.MouseClick +=new MouseEventHandler(parentclick);
            this.Description.MouseDoubleClick += new MouseEventHandler(parentdoubleclick);
            this.Description2.MouseClick += new MouseEventHandler(parentclick);
            this.Description2.MouseDoubleClick += new MouseEventHandler(parentdoubleclick);
            this.SaveFile.Click += new EventHandler(SaveFile_Click);
            this.DoubleBuffered = true;

            Image = img;
            Selected = false;
            
            parent.Controls.Add(this);
        }
开发者ID:androidhacker,项目名称:DotNetProjs,代码行数:27,代码来源:ImagePreview.cs


示例20: AddCardDiscardPile

        private void AddCardDiscardPile(MouseEventArgs e, Panel sourcePanel, DiscardPile discardPile, ref Point lastLocation, MouseEventHandler methodToHandle)
        {
            if (e.Button == MouseButtons.Left)
            {
            if (wPile.getCount() > 0)
            {
                Card card = wPile.getLastCardInPile();
                discardPile.AddToPile(card);
                if (discardPile.getCount() == 1)
                    sourcePanel.BackgroundImage = card.getCardImage();
                else
                {
                    Panel p = new Panel();
                    p.BackgroundImage = card.getCardImage();
                    p.Height = sourcePanel.Height;
                    p.Width = sourcePanel.Width;
                    lastLocation.Offset(0, 20);
                    p.Location = lastLocation;
                    lastLocation = p.Location;
                    p.MouseDown += new System.Windows.Forms.MouseEventHandler(methodToHandle);
                    this.Controls.Add(p);
                    p.BringToFront();
                }

                //Remove card from the waste pile
                wPile.removeCard(card);
                wastePilePicture.BackgroundImage = null;
            }
            }
        }
开发者ID:jmutabaz,项目名称:OOP-Solitaire-Part-I,代码行数:30,代码来源:CalculationGame.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# MouseInput类代码示例发布时间:2022-05-24
下一篇:
C# MouseEventArgs类代码示例发布时间: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