码迷,mamicode.com
首页 > 其他好文 > 详细

同机交流

时间:2014-11-17 17:38:06      阅读:152      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   ar   sp   for   div   on   art   

文本框之间内容的互相传递

 1 namespace exchangeTest
 2 {
 3     public partial class exchange : Form
 4     {
 5         public exchange()
 6         {
 7             InitializeComponent();
 8         }
 9         //往文本框二添加文本框一的内容
10         private void btnExchange_Click(object sender, EventArgs e)
11         {
12             text2.Text = text2.Text + text1.Text;
13             btnExchange.Enabled = false;
14             btnExchange0.Enabled = true;
15             btnExchange.Focus();
16         }
17         //往文本框一添加文本框二的内容
18         private void btnExchange0_Click(object sender, EventArgs e)
19         {
20             text1.Text = text1.Text + text2.Text;
21             btnExchange0.Enabled = false;
22             btnExchange.Enabled = true;
23             btnExchange.Focus();
24         }
25         //窗体装载,初始化控件,文本框获得输入焦点
26         private void Form1_Load(object sender, EventArgs e)
27         {
28             text1.Text = null;
29             text2.Text = null;
30             text1.Focus();
31         }
32     }
33 }

 

同机交流

标签:style   blog   color   ar   sp   for   div   on   art   

原文地址:http://www.cnblogs.com/Failbs/p/4103927.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!