java禁用键盘_如何禁用Windows手机键盘? (How to disable Windows phone keyboard?)

The problem that you run into is that the TextBox control on focus event is intercepted by the phone itself and it brings the keyboard up.

In short, there is NO way around this functionality. However, there is an alternative method.

Build your own textbox control.... This sounds crazy at first but is it? Not really. I build custom controls all the time at work. Granted usually they're a combination of other pre-made controls, but they are UserControls none the less.

So lets think about this, how to make your own?

I am not sure if you are able to use XAML elements in your project or not. However, if you are here is how to do it with a user control. Otherwise you will need to research how to make custom web controls. Likely a mix of CSS and HTML

Start with something simple like this

Have your grid handle your tap event.

Think of XAML as an upsidown cake. When you tap the Textblock, if the tap isn't handled it goes onto the boarder, then the grid. So if you have your grid handle the tap it will consume the inner taps as well.

So what do you do on your tap event?

Well here is where you would present your custom keyboard. You're going to want to identify which custom TextBlock was tapped on. You could probably do this by putting a custom tag on each.

As your user types on the custom keyboard, change the property value that the TextBlock is bound too. This will update the text on the screen.

That's pretty much a basic textblock.

Here are the assumptions to take from this post:

You know what a user control is

You know how to DataBind

You know about 2 way DataBinding

Hope this helps!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值