首页 > 其他 > 详细

虚拟键盘的代码

时间:2014-07-31 16:00:46      阅读:286      评论:0      收藏:0      [点我收藏+]
 1   //虚拟键盘
 2         private void TelNumber_Click(object sender, EventArgs e)
 3         {
 4             this.timer1.Enabled = false;
 5             PictureBox pic = (PictureBox)sender;
 6             if (pic.Tag.ToString().Equals("clear"))
 7             {
 8                 //输入完毕
 9                 textBox1.Text = "";
10             }
11             else if (pic.Tag.ToString().Equals("back"))
12             {
13                 //后退一个字符
14                 if (textBox1.Text.Length > 0)
15                 {
16                     textBox1.Text = textBox1.Text.Substring(0, textBox1.Text.Length - 1);       
17                 }
18             }
19             else
20             {
21                 //输入数字
22                 textBox1.Text = textBox1.Text + pic.Tag.ToString();
23                 ResetTime();
24                 this.timer1.Enabled = true;
25             }
26             textBox1.Select(textBox1.Text.Length, 0);//光标定位
27         }

 

虚拟键盘的代码,布布扣,bubuko.com

虚拟键盘的代码

原文:http://www.cnblogs.com/haopengloveyou/p/3880565.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!