实现效果:
知识运用:
API函数ShowCursor //控制鼠标指针的可视性
实现代码:
[DllImport("user32.dll", EntryPoint = "ShowCursor")] public extern static bool ShowCursor(bool bShow); private void button1_Click(object sender, EventArgs e) { ShowCursor(false); //鼠标隐藏 } private void button2_Click(object sender, EventArgs e) { ShowCursor(true); //鼠标显示 }