以编程方式在 WP7 上显示软输入面板 (SIP) [英] Display Soft Input Panel (SIP) on WP7 programmatically

查看:22
本文介绍了以编程方式在 WP7 上显示软输入面板 (SIP)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过代码以编程方式显示软输入面板 (SIP)/键盘.(我没有可以在其上指定 InputScope 的文本框).

How can I programmatically display the soft input panel (SIP)/keypad, via code. (I dont have a text-box on which I can specify the InputScope).

推荐答案

来自 Jeff Blankenburgs Windows Phone 7 的 31 天:

有时候,你想得到键盘来自您的用户的输入,即使您不想向他们展示实际的文本框.大概有有很多方法可以解决这个问题,但我已经一直在使用一个简单的方便的去完成.(如果您正在搜索出于这样做的原因,请考虑一个刽子手游戏.我不想要键盘始终可见,但我也不想在屏幕上出现 TextBox.)

Sometimes, you want to get keyboard input from your user, even when you don’t want to present them with an actual TextBox. There’s probably plenty of ways around this, but I’ve been using a handy one that is simple to accomplish. (If you’re searching for a reason to do this, think of a game of Hangman. I don’t want the keyboard visible always, but I also don’t want a TextBox on the screen.)

在您的页面上放置一个按钮.

Put a button on your page.

在您的页面上放置一个 TextBox,但要确保它对用户的视图是隐藏的.

Put a TextBox on your page, but make sure it’s hidden from the user’s view.

将其放置在屏幕外,使其完全透明(并在绝对背景中),或其他一些方法可以将其添加到您的可视化树中,但不会让用户看到它.

Either position it off screen, make it completely transparent (and in the absolute background), or some other method that allows it to get added to your visual tree, but doesn’t let the user see it.

在您的按钮上设置一个事件处理程序,在点击时将 Focus() 设置为隐藏的文本框.

Set an event handler on your button that sets Focus() to the hidden textbox when it’s clicked.

就是这样!这将允许您在没有用户看到文本框的情况下显示键盘.看到一个文本框.

That’s it! This will allow you to show the keyboard without the user seeing a textbox.seeing a textbox.

这篇关于以编程方式在 WP7 上显示软输入面板 (SIP)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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