窗体一的代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace name
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form2 f = new Form2(textBox1.Text,textBox1.Text);
f.Show();
}
}
}
窗体二的代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace name
{
public partial class Form2 : Form
{
string s = null;
public Form2(string str,string i)
{
InitializeComponent();
this.s = str;
label1.Text = s+i;
}
}
}