是否可以在 UWP 应用中更改鼠标指针 [英] Is it possible to change mouse pointer in UWP app

查看:23
本文介绍了是否可以在 UWP 应用中更改鼠标指针的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 UWP 应用中更改甚至隐藏鼠标指针?我唯一能找到的是:

Is it possible to change or even hide the mouse-pointer in a UWP app? The only thing I can find is this :

Windows.UI.Xaml.Window.Current.CoreWindow.PointerCursor = null;

但在 UWP 中,这不起作用.

But in UWP, this doesn't work.

推荐答案

是的,这可以通过设置Window.Current.CoreWindow.PointerCursor.如果将其设置为 null,则指针将被隐藏.否则,您可以使用 CoreCursorType 枚举来设置特定的系统点.例如使用它来设置箭头类型:

Yes this can be done by settings the Window.Current.CoreWindow.PointerCursor. If you set it to null, the pointer is hidden. Otherwise you can use the CoreCursorType enumeration to set a specific system point. For instance use this to set the Arrow type:

Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Arrow, 0);

您还可以使用资源文件添加自定义指针.有关详细信息,参见这篇博文.

You can also add custom pointers by using a resource file. For details, see this blogpost.

这篇关于是否可以在 UWP 应用中更改鼠标指针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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