Windows Phone 7 学习笔记三------文本框输入作用域

      WP7 对于在输入的时候可以设置文本框的输入作用域。也就是说,在对于文本输入的时可以设置不能的键盘。比如:设置数字时,只调用数字键盘出来,电子邮件也如此。由于目前在对文本框设置作用域时,没有智能提示,只能查询API了,可能这是WP7 这个版本的问题了。

1、只能对数据输入时用

<TextBlock Text="your number" Style="{StaticResourcePhoneTextLargeStyle}" />
<
TextBox InputScope="Number" Name="txtNumber"Height="71"Width="460" />

2、输入个人名称及信息

  <TextBlock Text="your name" Style="{StaticResource PhoneTextLargeStyle}" />
<
TextBox InputScope="PersonalFullName" Name="txtName" Height="71" Width="460" />

3、输入地址信息

<TextBlock Text="what country are you from?" Style="{StaticResourcePhoneTextLargeStyle}" />
<
TextBox InputScope="AddressCountryName" Name="txtCountry"Height="71"Width="460" />

4、电子邮件

<TextBlock Text="your email" Style="{StaticResource PhoneTextLargeStyle}" />
<
TextBox InputScope="EmailNameOrAddress" Name="txtEmail" Height="71" Width="460" />

5、URL

<TextBlockText="your favorite website" Style="{StaticResourcePhoneTextLargeStyle}" />
<
TextBox InputScope="Url" Name="txtWebsite"Height="71"Width="460" />

6、电话号码

<TextBlockText="call your best friend" Style="{StaticResourcePhoneTextLargeStyle}" />
<
TextBox InputScope="TelephoneNumber" Name="txtFriend"Height="71"Width="460" />

 

其归纳起来就六个枚举型

枚举值

说明

Number 调用输入数字键盘
PersonalFullName 调用字母键盘
AddressCountryName 调用字母键盘
EmailNameOrAddress 调用有@,.COM的键盘
Url 调用有www,http.键盘
TelephoneNumber 调用数字键盘
posted @ 2011-05-04 22:51  阳光追梦  阅读(596)  评论(1编辑  收藏  举报
/*快速评论*/ #div_digg { position: fixed; bottom: 10px; right: 15px; border: 2px solid #ECD7B1; padding: 10px; width: 140px; background-color: #fff; border-radius: 5px 5px 5px 5px !important; box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5); } /** 不知道为什么页面加载完成时还读不到div_digg。可能也是动态生成的。 所以这里只能用定时器 不断的读取,当读取到了再给它动态添加快捷按钮 **/ //自定义 定时器[当元素加载完成是执行回调函数] function customTimer(inpId,fn) { if ($(inpId).length) { fn(); } else { var intervalId = setInterval(function () { if ($(inpId).length) { //如果存在了 clearInterval(intervalId); // 则关闭定时器 customTimer(inpId,fn); //执行自身 } }, 100); } } //页面加载完成是执行 $(function () { customTimer("#div_digg", function () { var div_html = "
\ 关注\  | \ 顶部\  | \ 评论\
"; $("#div_digg").append(div_html); //tbCommentBody }); });