1、 重载窗体Form2中的 构造函数 string str = String.Empty;//接收传过来的值 public Form2(string textValue) { InitializeComponent(); this.str = textValue; } 2、 主窗体调用子窗体时候传参数:主窗体Form1的Button事件 Form2 f2 = new Form2(textBox1.Text); f2.ShowDialog();
C#利用子窗体中的构造函数 (实现了父窗体给子窗体的传值,但是子窗体的值回传暂未实现)
猜你喜欢
转载自blog.csdn.net/qq_28335347/article/details/49995069
今日推荐
周排行