你如何在Windows Phone键盘一个提交按钮? [英] How do you get a submit button in the Windows Phone keyboard?

查看:141
本文介绍了你如何在Windows Phone键盘一个提交按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要的白色箭头出现在我的文本输入框让用户拥有着其他的不是从键盘敲击离开或使用硬件后退按钮的方式。

I want the white arrow to appear in my text input boxes so users have a way of forward other than tapping away from the keyboard or using the hardware Back button.

搜索领域做到这一点的系统UI。 ?我如何

The search fields do this in the system UI. How do I?

下面是我的代码
XAML:

Here's my code XAML:

<TextBox x:Name="InputBox" InputScope="Text" AcceptsReturn="True" TextChanged="InputBox_TextChanged"/>



CS:

CS:

void InputBox_TextChanged(object sender, KeyEventArgs e)
{
    // e does not have Key property for capturing enter - ??
}



一个快速的注意,我已经试过AcceptsReturn作为也为False。

One quick note, I have tried AcceptsReturn as False also.

推荐答案

,而不是处理框TextChanged 方法,处理的KeyUp 文本框的方法:

Instead of handling the TextChanged method, handle the KeyUp method of the Textbox:

private void InputBox_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)
{
      if (e.Key == Key.Enter)
      {
           //enter has been pressed
      }
}

这篇关于你如何在Windows Phone键盘一个提交按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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