如何在WPF中更改Windows光标? [英] How to change Windows cursor in WPF?

查看:158
本文介绍了如何在WPF中更改Windows光标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢在用户单击按钮时更改光标.我可以使用FrameworkElement.Cursor.但这只会更改我当前应用程序的光标.

但是我需要更改整个Windows光标.我的意思是,如果将鼠标移到我的应用程序之外,它将显示我的光标(而不是默认箭头).

如何实现?

解决方案

要完成此操作,您必须更改注册表值,然后执行API调用,请查看此MSDN帖子以获取有关如何执行此操作的更多详细信息:

如何更改使用Visual C#.NET来显示系统的光标?

也请检查此链接:

使用C#更改全局鼠标光标或光标方案?

I like to change the cursor, when user clicks a button. I can use FrameworkElement.Cursor. But it only changes the cursor for my current App.

But I need my entire Windows cursor should change. I mean if you move the mouse outside the my app, it should show my cursor (not the default arrow).

How to achieve this?

解决方案

In order to accomplish this you have to change a registry value then perform an API call, check this MSDN post for more details on how to do it:

How to change the system’s cursor using Visual C#.NET?

Also check this link:

Changing global mouse cursor OR cursor scheme with C#?

这篇关于如何在WPF中更改Windows光标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆