コード例 #1
0
        private void Savebutton_Click(object sender, EventArgs e)
        {
            studentName = StudentNametextBox.Text;

            contactNumber = ContactNumbertextBox.Text;

            emailAddress = EmailAddresstextBox.Text;

            Student studentObj = new Student( StudentNametextBox.Text, ContactNumbertextBox.Text , EmailAddresstextBox.Text);

            ListViewItem item = new ListViewItem();
            item.Tag = studentObj;
            item.Text = studentObj.StudentName_;
            item.SubItems.Add(studentObj.ContactNumber_);
            item.SubItems.Add(studentObj.EmailAddress_);
            StudentlistView.Items.Add(item);

            ClearTextBox();
        }
コード例 #2
0
        private void StudentlistView_DoubleClick(object sender, EventArgs e)
        {
            ListViewItem selectedListViewCell = StudentlistView.SelectedItems[0];
            selectedStudent = (Student)selectedListViewCell.Tag;
            SetDataInTextBoxes();

            selectedRowIndex = StudentlistView.SelectedIndices[0];

            Savebutton.Visible = false;
            Cancelbutton.Visible = true;
            Updatebutton.Visible = true;
        }
コード例 #3
0
        private void Updatebutton_Click(object sender, EventArgs e)
        {
            Student StudentObj = new Student(StudentNametextBox.Text, ContactNumbertextBox.Text, EmailAddresstextBox.Text);

            ListViewItem item = new ListViewItem();
            item.Tag = StudentObj;
            item.Text = StudentObj.StudentName_;
            item.SubItems.Add(StudentObj.ContactNumber_);
            item.SubItems.Add(StudentObj.EmailAddress_);
            StudentlistView.Items[selectedRowIndex] = item;

            MakeOperationForSaveButton();
        }