C#中的Windows应用程序 [英] Windows Application In C#

查看:93
本文介绍了C#中的Windows应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何在Windows应用程序C#.net中以相同形式将数值从一个文本框发送到另一个文本框

请以C#语言给出答案

I Want to known about how to send numeric value from one textbox to another textbox in same Form in Windows application C#.net

Plz Give answer in C# language

推荐答案

private void txtName_TextChanged(object sender, EventArgs e)
{
      txtOtherName.Text = txtName.Text;
}


要将值从一个文本框传输到另一个文本框,您可以执行以下操作:
To transfer the value from one textbox to another, you would do something like this:
Textbox2.text = Textbox1.text;


您可以将其放在按钮单击事件中,以便在单击按钮时更新值.


You could put that inside a button click event so that when the button was clicked, the value was updated.


private void Form1_Load(object sender, EventArgs e)
{
    this.textBox1.DataBindings.Add("Text", textBox2, "Text");
    this.textBox2.DataBindings.Add("Text", textBox1, "Text");

}


这篇关于C#中的Windows应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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