简体   繁体   English

鼠标C#上的Winform

[英]Winform on the mouse c#

I am developing a loading screen, and I need the User mouse stay on behind the windows forms. 我正在开发一个加载屏幕,我需要用户鼠标停留在Windows窗体后面。 I searched the Internet and found nothing related to it. 我搜索了互联网,但没有找到任何相关信息。 It is possible to create a form that is on top of the mouse pointer? 是否可以创建一个位于鼠标指针上方的窗体? (It seems a little crazy but that's it) (似乎有点疯狂,仅此而已)

Sorry, my English is bad. 抱歉,我的英语不好。

The only solution I can think of is by hiding the mouse for the application. 我能想到的唯一解决方案是隐藏应用程序的鼠标。

Cursor.Hide();

Make sure you switch it back on when appropriate! 确保在适当的时候将其重新打开!

Note that users can get very confused when the mouse cursor disappears. 请注意,当鼠标光标消失时,用户可能会非常困惑。

Here is something similar with good code example. 这是带有良好代码示例的类似内容。

// Set cursor as hourglass Cursor.Current = Cursors.WaitCursor; //将光标设置为沙漏Cursor.Current = Cursors.WaitCursor;

// Execute your time-intensive hashing code here... //在此处执行耗时的哈希代码...

// Set cursor as default arrow Cursor.Current = Cursors.Default; //将光标设置为默认箭头Cursor.Current = Cursors.Default;

How can I make the cursor turn to the wait cursor? 如何使光标转向等待光标?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM