WPF PasswordBox和虚拟键盘(触摸) [英] WPF PasswordBox and virtual keyboard (touch)

查看:2207
本文介绍了WPF PasswordBox和虚拟键盘(触摸)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个正在使用的触摸屏上没有键盘一个WPF应用程序PasswordBox。这是一个问题,因为PasswordBox被点击时的虚拟键盘图标未示出。

I have a PasswordBox in a WPF application that is used on a touch screen without keyboard. This is a problem since the virtual keyboard icon is not shown when the PasswordBox is clicked.

我的感觉它应该有一些做InputMethod及其IsInputMethodEnabled财产,但下面还是不工作:

I get the feeling it should have something to do with InputMethod and its IsInputMethodEnabled property, but the following still does not work:

<PasswordBox InputMethod.IsInputMethodEnabled="True"/>

是否有可能迫使虚拟键盘弹出?

Is it possible to force the virtual keyboard to pop up?

作为一种变通方法,我创建一个自定义的虚拟键盘,直接修改PasswordBox.Password ..

As a workaround I created a custom virtual keyboard that directly modifies the PasswordBox.Password..

推荐答案

我认为PasswordBox控制一点儿也不支持这一点,因为它不是直接从一个TextBox继承。相反,它是从Control继承。

I believe that the PasswordBox control does'nt support this, because it is not directly inherited from a TextBox. Instead it is inherited from control.

我对你没有直接回答,但也有一些非常糟糕的变通办法问题

I have no direct answer for you, but there are some really bad workarounds for this problem

一)做propably最好的方法是创建你自己的控制,从TextBox继承。

a) the propably best way to do is to create you own control which inherits from textbox.

b)你可以把一个文本框在passwordbox。当用户点击它,你处理的文本框GotFocus事件,隐藏的文本框,将焦点放到你的密码箱。

b) you can put a textbox over the passwordbox. When the user clicks on it you handle the textboxes GotFocus event, hide the textbox and give the focus to you password box.

C)可以以编程方式启动osk.exe,这也将带来键盘正面

c) you can programmatically start the "osk.exe" which will also bring the keyboard to the front

这篇关于WPF PasswordBox和虚拟键盘(触摸)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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