Exemplo n.º 1
0
 private void InputStudentForm_Load(object sender, EventArgs e)
 {
     htDept = StudentManagerAction.GetDeptList();
     cbDept.Items.Clear();
     foreach (DictionaryEntry entry in htDept)
     {
         cbDept.Items.Add(entry.Key);
     }
 }
 private void button1_Click(object sender, EventArgs e)
 {
     this.tbStudentNo.Enabled = false;
     if (lvStudentList.SelectedItems.Count == 0)
     {
         MessageBox.Show("请选择一条信息", "Error", MessageBoxButtons.OK);
         return;
     }
     else
     {
         this.ClientSize    = new System.Drawing.Size(541, 462);
         tbStudentNo.Text   = lvStudentList.SelectedItems[0].SubItems[0].Text;
         tbStudentName.Text = lvStudentList.SelectedItems[0].SubItems[1].Text;
         cbSex.Text         = lvStudentList.SelectedItems[0].SubItems[2].Text;
         tbBirthday.Text    = lvStudentList.SelectedItems[0].SubItems[3].Text;
         ht = StudentManagerAction.GetDeptList();
         foreach (DictionaryEntry de in ht)
         {
             cbDept.Items.Add(de.Key.ToString());
         }
         cbDept.Text = lvStudentList.SelectedItems[0].SubItems[4].Text;
     }
 }