Visual C# 隐藏显示鼠标的源码实例
代码说明:
Visual C#显示隐藏鼠标的一个例子,隐藏鼠标后,使用Tab键移动光标,从代码中可发现,隐藏鼠标只需将ShowCursor(false);即可,显示时就这样:ShowCursor(true);面向C#初学者。下面是核心的代码: //重写API函数 [System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint = "ShowCursor")] public extern static bool ShowCursor(bool bShow); private void btnHide_Click(object sender, EventArgs e) { ShowCursor(false);//鼠标隐藏 } private void btnShow_Click(object sender, EventArgs e) { ShowCursor(true);//鼠标显示 }
下载说明:请别用迅雷下载,失败请重下,重下不扣分!