private void button1_Click(object sender, EventArgs e) { String str; typingWindow addStudent = new typingWindow(); addStudent.ShowDialog(); // this test avoids an empty filling in the ListView if (addStudent.validTyping ) { MessageBox .Show (addStudent.StudentName + " " + addStudent.StudentGrade); str = addStudent.StudentName + " - " + addStudent.StudentGrade; _list.Add(str); refreshListView(); } }
private void listView1_SelectedIndexChanged(object sender, EventArgs e) { typingWindow addStudent = new typingWindow(); }