C#构造函数传参,将datagridview中的值赋给其他窗体textbox中

变量被调用的窗体Form1:

private void buttonX8_Click(object sender, EventArgs e)
{
      MessageUpdate f = new MessageUpdate(a2, b2, c2, d2, E2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2);//a2............r2是该窗体中已赋值的变量
      f.Show();
}

 

调用变量的窗体Form2:

public Form2(string a3, string b3, string c3, string d3, string e3, string f3, string g3, string h3, string i3, string j3, string k3, string l3, string m3, string n3, string o3, string p3, string q3, string r3)
{
InitializeComponent();
textBoxX1.Text = a3;
comboBox1.Text = b3;
textBoxX3.Text = c3;
textBoxX4.Text = d3;
textBoxX5.Text = e3;
comboBox2.Text = f3;
comboBox3.Text = g3;
comboBox4.Text = h3;
comboBox5.Text = i3;
textBoxX10.Text = j3;
textBoxX11.Text = k3;
textBoxX12.Text = l3;
textBoxX13.Text = m3;
textBoxX14.Text = n3;
textBoxX15.Text = o3;
textBoxX2.Text = p3;
textBoxX6.Text = q3;
dateTimePicker1.Text = r3;
}

转载于:https://www.cnblogs.com/shuanglangdeliubei/p/5692581.html

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值