摘要: private void Form1_Load(object sender, EventArgs e) { this.MouseWheel += new MouseEventHandler(Form1_MouseWheel); } void Form1_MouseWheel(object sender, Mo... 阅读全文
posted @ 2013-01-15 16:44 quanzhan 阅读(451) 评论(0) 推荐(0) 编辑
摘要: 可以用Control.MousePosition获得当前鼠标的坐标,使用PointToClient计算鼠标相对于某个控件的坐标,如下//鼠标相对于屏幕左上角的坐标Point screenPoint = Control.MousePosition;//鼠标相对于窗体左上角的坐标Point formPoint = this.PointToClient(Control.MousePosition);//鼠标相对于contextMenuStrip1左上角的坐标Point contextMenuPoint = contextMenuStrip1.PointToClient(Control.MousePo 阅读全文
posted @ 2013-01-15 15:02 quanzhan 阅读(927) 评论(0) 推荐(0) 编辑
摘要: 1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Data; 5 using System.Drawing; 6 using System.Text; 7 using System.Windows.Forms; 8 9 namesp... 阅读全文
posted @ 2013-01-15 10:55 quanzhan 阅读(505) 评论(0) 推荐(0) 编辑