如果我从form1中选择一个列表视图行,我希望将form1行中的“一些”数据放置在form2列表视图中
Form 1代码:
private void StandardUserListView_MouseDoubleClick(object sender, MouseEventArgs e)
{
ViewUserDetail vud = new ViewUserDetail(StandardUserListView.SelectedItems[0].SubItems[1].Text, StandardUserListView.SelectedItems[0].SubItems[2].Text, StandardUserListView.SelectedItems[0].SubItems[3].Text, StandardUserListView.SelectedItems[0].SubItems[4].Text);
vud.ShowDialog();
}
Form 2代码:
public ViewUser vu;
private void ViewUserDetail_Shown(object sender, EventArgs e)
{
ScheduleListView.Items[0].SubItems[0].Text = vu.StandardUserListView.SelectedItems[0].SubItems[0].Text.ToString();
ScheduleListView.Items[0].SubItems[1].Text = vu.StandardUserListView.SelectedItems[0].SubItems[1].Text.ToString();
}