windows phone 鍵盤開發

來源:互聯網
上載者:User
文章目錄
  • 使用預設鍵盤
  • 進入一個頁面,自動彈出鍵盤
  • 聊天用鍵盤
  • Url
  • Email
  • Name  or Phone Number
  • PostalAddress
  • PhoneNumber
鍵盤操作

鍵盤操作很簡單,直接代碼

使用預設鍵盤

            InputScope scope = new InputScope();

            InputScopeName name = new InputScopeName();

 

            name.NameValue = InputScopeNameValue.Default;  //<--Here

            scope.Names.Add(name);

 

            txtK1.InputScope = scope;

進入一個頁面,自動彈出鍵盤

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)

        {

            base.OnNavigatedTo(e);

 

            //This code opens up the keyboard when you navigate to the page.

            txtK1.UpdateLayout();

            txtK1.Focus();

        }

聊天用鍵盤

含有一個smiley = smily 微笑表情

  //You can set the Keyboard Input Scope by using either XAML or code.

            //See the XAML file for the XAML version.

            //The code version is below.

 

            InputScope scope = new InputScope();

            InputScopeName name = new InputScopeName();

 

            name.NameValue = InputScopeNameValue.Chat;  //<--Here

            scope.Names.Add(name);

 

            txtK2.InputScope = scope;

 

            //To create keyboard 2, you can use any of the following Input Scopes.

            //--------------------------------------------------------------------

            // Chat

            // Text

Url

含有。Com

  InputScope scope = new InputScope();

            InputScopeName name = new InputScopeName();

 

            name.NameValue = InputScopeNameValue.Url;  //<--Here

            scope.Names.Add(name);

 

            txtK3.InputScope = scope;

Email

含有。com和@表徵圖

//You can set the Keyboard Input Scope by using either XAML or code.

            //See the XAML file for the XAML version.

            //The code version is below.

 

            InputScope scope = new InputScope();

            InputScopeName name = new InputScopeName();

 

            name.NameValue = InputScopeNameValue.EmailNameOrAddress;  //<--Here

            scope.Names.Add(name);

 

            txtK4.InputScope = scope;

 

            //To create keyboard 4, you can use any of the following Input Scopes.

            //--------------------------------------------------------------------

            // EmailNameOrAddress

            // EmailSmtpAddress

            // EmailUserName

Name  or Phone Number

就是直接顯示數字鍵台(含有 123 表徵圖 點擊 會開啟數字鍵台)

  InputScope scope = new InputScope();

            InputScopeName name = new InputScopeName();

 

            name.NameValue = InputScopeNameValue.NameOrPhoneNumber;  //<--Here

            scope.Names.Add(name);

 

            txtK5.InputScope = scope;

 

            //To create keyboard 5, you can use any of the following Input Scopes.

            //--------------------------------------------------------------------

            // NameOrPhoneNumber

 

PostalAddress

和上面的區別是 (顯示&123表徵圖,點擊後不光顯示數字還有一些常用標點符號)

     InputScope scope = new InputScope();

            InputScopeName name = new InputScopeName();

 

            name.NameValue = InputScopeNameValue.PostalAddress;  //<--Here

            scope.Names.Add(name);

 

            txtK6.InputScope = scope;

 

            //To create keyboard 6, you can use any of the following Input Scopes.

            //--------------------------------------------------------------------

            // AddressStreet

            // CurrencyAmountAndSymbol

            // CurrencyChinese

            // PostalAddress

            // PostalCode

            // Time

PhoneNumber

顯示數字鍵台

        InputScope scope = new InputScope();

            InputScopeName name = new InputScopeName();

 

            name.NameValue = InputScopeNameValue.TelephoneNumber;  //<--Here

            scope.Names.Add(name);

 

            txtK7.InputScope = scope;

 

            //To create keyboard 7, you can use any of the following Input Scopes.

            //--------------------------------------------------------------------

            // TelephoneAreaCode

            // TelephoneCountryCode

            // TelephoneLocalNumber

            // TelephoneNumber

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.