当前位置:首页 > 开发 > C# > 正文内容

C# 控件判断鼠标位置

C#6个月前 (12-30)
        /// <summary>
        /// 鼠标抬起事件
        /// </summary>
        /// <param name="e"></param>
        protected override void OnMouseUp(MouseEventArgs e)
        {
            base.OnMouseUp(e);
            Point mouseLocation = this.PointToClient(Cursor.Position);
            if (this.ClientRectangle.Contains(mouseLocation))
            {
                //鼠标在控件区域上
            }
        }


转载请注明出处。

本文链接:http://www.pythonopen.com/?id=1644

相关文章

C# 获取目录大小

public static long GetDirSize(strin...

C# SHA1

GetFileSHA1        ...

C# 缩减代码量的一些方式

static void Main() { Thread thre...

C# double转为string并保留两位小数

在 C# 中,可以使用多种方式将 double 类型的数据转换为 string 类型并保留两位小数,...

C# System.IO.Path

System.IO.Path.GetExtension返回指定的路径字符串的扩展名。string&n...