///
///Form1
///
private void button1_Click(object sender, EventArgs e)
{
Form2 frm = new Form2();
int a = listView1.FocusedItem.Index;//获取当前选择项索引
for (int i = 0; i < 5;i++ )
{
frm.str[i] = this.listView1.Items[a].SubItems[i].Text;
}
frm.ShowDialog();
}
///
///Form2
///
public string[] str = new string[5];
public Form2(Form1 frm ;)
{
InitializeComponent();
}
private void Form2_Load(object sender, EventArgs e)
{
this.textBox1.Text = str[0];
this.textBox2.Text = str[1];
this.textBox3.Text = str[2];
this.textBox4.Text = str[3];
this.textBox5.Text = str[4];
}
Form2 用来显示 选择项的值 修改后保存