Create a soft keyboard, createkeyboard

Source: Internet
Author: User

Create a soft keyboard, createkeyboard

Using System; using System. collections. generic; using System. componentModel; using System. data; using System. drawing; using System. linq; using System. text; using System. windows. forms; namespace keyboardDemo {public partial class Form1: Form {// <summary> // tu juwen // Soft Keyboard http://code.msdn.microsoft.com/CSSoftKeyboard-0a86f914 /// </Summary> public Form1 () {InitializeComponent ();} /// <summary> //// </summary> /// <param name = "sender"> </param> /// <param name = "e "> </param> private void Form1_Load (object sender, eventArgs e) {}/// <summary> //// </summary> /// <param name = "sender"> </param> /// <param name = "e"> </param> private void button#click (object sender, eventArgs e) {Form2 f = new Form2 (); f. press + = MiniK EyboardHandler; f. showDialog ();} /// <summary> //// </summary> /// <param name = "sender"> </param> /// <param name = "e "> </param> private void MiniKeyboardHandler (object sender, miniKeyboardArgs e) {if (this. textBox1.Text = "Your backpspace") {if (this. textBox1.Text. length! = 0) {}} else {textBox1.Text + = e. keyCode; string s = this. textBox1.Text; if (s. contains ("Your backpspace") // remove a string {s = s. replace ("reverse backpspace", ""); if (s. length> 0) {s = s. substring (0, s. length-1); this. textBox1.Text = s;} else {this. textBox1.Text = s ;}}}}}}
Using System; using System. collections. generic; using System. componentModel; using System. data; using System. drawing; using System. linq; using System. text; using System. windows. forms; namespace keyboardDemo {public partial class Form2: Form {bool isShift = true; /// <summary> //// </summary> /// <param name = "sender"> </param> /// <param name = "e "> </param> public delegate void MiniKeyboardHandler (object Sender, MiniKeyboardArgs e); // <summary> // </summary> public event MiniKeyboardHandler Press; /// <summary> ///// </summary> private void BindEvent () {foreach (Control ctl in this. controls) {if (ctl is Button) ctl. click + = MinikeyboardPress; }}/// <summary> /// </summary> public Form2 () {InitializeComponent (); BindEvent ();} /// <summary> ///// </summary> /// <param name = "send Er "> </param> // <param name =" e "> </param> private void Form2_Load (object sender, EventArgs e) {}/// <summary> //// </summary> /// <param name = "sender"> </param> /// <param name = "e"> </param> private void MinikeyboardPress (object sender, eventArgs e) {// case-insensitive if (Button) sender ). text = "Shift") {if (isShift = true) {isShift = false; string s = this. button1.Text; s = s. toUpper (); this. button1. Text = s;} else {isShift = true; string s = this. button1.Text; s = s. toLower (); this. button1.Text = s ;}} else {OnMiniKeyboardHandle (new MiniKeyboardArgs (Button) sender ). text ));}} /// <summary> ///// </summary> /// <param name = "e"> </param> private void OnMiniKeyboardHandle (MiniKeyboardArgs e) {MiniKeyboardHandler temp = Press; if (temp! = Null) temp (this, e );} /// <summary> //// </summary> /// <param name = "sender"> </param> /// <param name = "e "> </param> private void button6_Click (object sender, eventArgs e) {// if (isShift = true) // {// isShift = false; // this. button1.Text. toUpper (); // else // {// isShift = true; /// }}/// <summary> //// </summary> public class MiniKeyboardArgs: EventArgs {public string KeyCode {g Et; private set;} public MiniKeyboardArgs (string code) {if (code = "Your backpspace") {if (code. Length! = 0) {KeyCode = code;} else {KeyCode = code; // KeyCode = ""; Caps Lock} else if (code = "Shift ") {KeyCode = "" ;}else if (code = "Caps Lock") {KeyCode = "" ;}else {KeyCode = code ;}}}}

 


How to understand hard/soft keyboard

Could you tell me whether the attribute that controls whether the soft keyboard is disabled or not is this: android: windowSoftInputMode = "stateAlwaysHidden"? I don't know where to set it wrong (note: I made the following settings for EditText: android: inputType = "number" to use hardKeyboard to enter numbers.) the expected effect is that soft Keyboard should not be displayed in this activity... I wonder if prawn is easy to enlighten me
 
Soft keyboard piano is the same as the keyboard

Different !!!! For us, the keyboard should be a "compile keyboard"
What you said is that "Electro-Piano" does not have the editing function!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.