怎样隐藏或显示鼠标? c# winform

zwhe 2004-01-03 02:59:54
怎样隐藏或显示鼠标? c# winform
...全文
164 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
shawanti 2004-01-03
  • 打赏
  • 举报
回复
using System.Runtime.InteropServices;
[DllImport("user32.dll", EntryPoint="ShowCursor",CharSet=CharSet.Auto)]
public extern static void ShowCursor(int status);


调用ShowCursor(0)或ShowCursor(1)来设置.
与上面的一样.只是调用个api.
qxl12343 2004-01-03
  • 打赏
  • 举报
回复
[System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint="ShowCursor")] internal extern static bool ShowCursor ( bool bShow ) ;
// 隐藏 显示 鼠标

public static void Hide()
{
ShowCursor( false ) ;
}

public static void Show()
{
ShowCursor( true ) ;
}

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧