将Form1中textbox值传到Form2———— Form1中磨让缓代码
private void button1_Click(object sender, EventArgs e)
{
Form2 f = new Form2(textBox1.Text); //将值传瞎模到Form2
f.Show();
}
Form2代码:
public partial class Form2 : Form
{
string b; //你说的String变量
public Form2(string a) /滑樱/a等同于Form1textbox值
{
this.b = a; //将Form1的textbox值传给b
InitializeComponent();