[英]How to send the data of textbox to a label that is in another form then click that button again then send it in another label
I already sent the data of the textbox in the label that is in another form but what I want is, I want to click that button again then send the result to another label.我已经在 label 中以另一种形式发送了文本框的数据,但我想要的是,我想再次单击该按钮,然后将结果发送到另一个 label。
this is my code这是我的代码
Form 1's code - this is the receiver表格 1 的代码 - 这是接收方
public partial class Form1 : Form
{
public string IDD { get; set; }
public string CN { get; set; }
public string ADD { get; set; }
public string TIME { get; set; }
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
ClientID.Text = IDD;
ClientName.Text = CN;
ClientAdd.Text = ADD;
ClientTime.Text = TIME;
}
Form 2's code - this is the sender表格 2 的代码 - 这是发件人
private void btnBack_Click(object sender, EventArgs e)
{
Form1 frm1 = new Form1();
frm1.IDD = txtID.Text;
frm1.CN = txtCN.Text;
frm1.ADD = txtAdd.Text;
frm1.TIME = dateTimePicker1.Text;
frm1.ShowDialog();
}
You can do this by initializing parameterized constructors and holding them in auto-implemented properties.您可以通过初始化参数化构造函数并将它们保存在自动实现的属性中来做到这一点。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.