windows phone中的输入控件研究

windows phone7中的文本输入框类似Web中的控件,包括密码输入框和文本输入框。

密码输入框:<PasswordBox />不必过多解释,你懂的。

文本框:

<TextBox Height="72" HorizontalAlignment="left" Margin="31,134,0,0" name="txtPhone" Text="" Width="480">

<TextBox.InputScope>

<InputScope>

<InputScopeName NameValue="TelephoneNumber"></InputScopeName>

</InputScope>

</TextBox.InputScope>

</TextBox>

如何获取Scope列表,

//添加引用using System.Reflection

FieldInfo[] array = typeof(InputScopeNameValue).GetFields(BindingFlags.Public | BindingFlags.Static);

除了默认的Text模式和TelephoneNumber之外,还有Url和Chat也是常用的Scope;

补充:其中Url选项中的前往事件为TextInputStart.

或者编辑keyup事件,if(e.key == Key.Enter){}

posted @ 2011-12-01 23:42  风花雪月  阅读(166)  评论(0编辑  收藏  举报