gpt4 book ai didi

c# - 是否可以让我的 c# wpf 程序知道用户是否有触摸屏?

转载 作者:可可西里 更新时间:2023-11-01 08:20:10 25 4
gpt4 key购买 nike

我有一个带有刷卡系统的登录应用程序,人们只有在拥有触摸屏时才能使用该系统。他们可以通过刷个人图案刷卡码登录。

如果用户有触摸屏,是否可以在 C# 或 WPF 中 checkin ?即使他当时没有使用触摸功能?

最佳答案

在 C# 代码中,通过在 中使用 System.Windows.Input 命名空间来确定触摸屏是否存在(但不检查它是单点还是多点触摸设备) PresentationCore.

    public bool HasTouchInput()
{
foreach (TabletDevice tabletDevice in Tablet.TabletDevices)
{
//Only detect if it is a touch Screen not how many touches (i.e. Single touch or Multi-touch)
if(tabletDevice.Type == TabletDeviceType.Touch)
return true;
}

return false;
}

关于c# - 是否可以让我的 c# wpf 程序知道用户是否有触摸屏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5673556/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com