C#隐藏、显示鼠标指针

1、添加命名空间

创新互联公司是一家专业提供南平企业网站建设,专注与网站建设、成都网站建设、H5技术、小程序制作等业务。10年已为南平众多企业、政府机构等服务。创新互联专业网站设计公司优惠进行中。

using System.Runtime.InteropServices;

2、添加DLL引用

/// 
/// 控制鼠标指针显示和隐藏
/// 
public class MousePointer
{
    /// 
    /// 调用系统API函数操作鼠标指针
    /// 
    /// 0表示隐藏鼠标指针,1表示显示鼠标指针
    [DllImport("user32.dll", EntryPoint = "ShowCursor", CharSet = CharSet.Auto)]
    public static extern void ShowCursor(int status);
}``

分享名称:C#隐藏、显示鼠标指针
网页网址:http://pwwzsj.com/article/jshdog.html