摘要:
private void Form1_Load(object sender, EventArgs e) { this.MouseWheel += new MouseEventHandler(Form1_MouseWheel); } void Form1_MouseWheel(object sender, Mo... 阅读全文
摘要:
可以用Control.MousePosition获得当前鼠标的坐标,使用PointToClient计算鼠标相对于某个控件的坐标,如下//鼠标相对于屏幕左上角的坐标Point screenPoint = Control.MousePosition;//鼠标相对于窗体左上角的坐标Point formPoint = this.PointToClient(Control.MousePosition);//鼠标相对于contextMenuStrip1左上角的坐标Point contextMenuPoint = contextMenuStrip1.PointToClient(Control.MousePo 阅读全文
摘要:
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... 阅读全文