accp7.0S2深入.NET和C#第二章上机3

namespace 上机3
{
    public partial class frmshow : Form
    {
        public se[] engineers = new se[3];
        public frmshow()
        {
            InitializeComponent();
        }
        private void frmshow_Load(object sender, EventArgs e)
        {
            engineers[0]=new se();
            engineers[0].worknum = "111";
            engineers[0].name = "王小毛";
            engineers[0].age = "26";
            engineers[0].assess = "未评价";
            engineers[0].score = "0";
            engineers[1] = new se();
            engineers[1].worknum = "112";
            engineers[1].name = "周新宇";
            engineers[1].age = "22";
            engineers[1].assess = "未评价";
            engineers[1].score = "0";
            engineers[2] = new se();
            engineers[2].worknum = "113";
            engineers[2].name = "张烨";
            engineers[2].age = "30";
            engineers[2].assess = "未评价";
            engineers[2].score = "0";
            foreach (se item in engineers)
            {
                ListViewItem li = new ListViewItem(item.worknum);
                li.SubItems.Add(item.name);
                li.SubItems.Add(item.age);
                li.SubItems.Add(item.assess);
                li.SubItems.Add(item.score);
                listView1.Items.Add(li);
            }
            
        }

        private void listView1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            frmjudge f = new frmjudge();
            f.data = listView1.SelectedItems[0];
            f.Show();
        }

namespace 上机3
{
    public partial class frmjudge : Form
    {
        public frmjudge()
        {
            InitializeComponent();
        }
        public ListViewItem data;
        private void frmjudge_Load(object sender, EventArgs e)
        {
            textBox1.Text = data.SubItems[1].Text;
            textBox1.ReadOnly = true;
        }
        private void button1_Click(object sender, EventArgs e)
        {
            data.SubItems[3].Text = textBox2.Text;
            data.SubItems[4].Text = textBox3.Text;
                this.Close();
        }
    }
}

你可能感兴趣的:(accp7.0S2深入.NET和C#第二章上机3)